Public/Logging/New-KriticalUtcmLogEntry.ps1

<#
.SYNOPSIS
    Kritical.UTCM wrapper over Microsoft365DSC helper New-M365DSCLogEntry
    (category: Logging, module: M365DSCLogEngine).

.DESCRIPTION
    Thin delegating passthrough — logic stays in Microsoft365DSC upstream;
    Kritical.UTCM provides the friendly namespace + citation registration.

    Install-Module Microsoft365DSC -Scope CurrentUser BEFORE calling.

.NOTES
    Category: Logging
    Module: M365DSCLogEngine
    Params: 5
#>

function New-KriticalUtcmLogEntry {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)] [String] $Source,
        [Parameter(Mandatory)] [String] $Message,
        [Object] $Exception,
        [PSCredential] $Credential,
        [String] $TenantId
    )

    if (-not (Get-Command -Name 'New-M365DSCLogEntry' -ErrorAction SilentlyContinue)) {
        throw '[KriticalUtcm] New-M365DSCLogEntry not available — Install-Module Microsoft365DSC -Scope CurrentUser then re-run'
    }
    try {
        & 'New-M365DSCLogEntry' @PSBoundParameters
    } catch {
        Write-Error ('[KriticalUtcm/New-KriticalUtcmLogEntry] ' + 'New-M365DSCLogEntry' + ' failed: ' + $_.Exception.Message)
        throw
    }
}