Public/Logging/Add-KriticalUtcmEvent.ps1

<#
.SYNOPSIS
    Kritical.UTCM wrapper over Microsoft365DSC helper Add-M365DSCEvent
    (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: 6
#>

function Add-KriticalUtcmEvent {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)] [String] $Message,
        [Parameter(Mandatory)] [String] $Source,
        [String] $EntryType,
        [UInt32] $EventID,
        [String] $EventType,
        [String] $TenantId
    )

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