Public/Permissions/Write-KriticalUtcmLogEntry.ps1

<#
.SYNOPSIS
    Kritical.UTCM wrapper over Microsoft365DSC helper Write-LogEntry
    (category: Permissions, module: M365DSCPermissions).

.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: Permissions
    Module: M365DSCPermissions
    Params: 2
#>

function Write-KriticalUtcmLogEntry {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)] [String] $Message,
        [String] $Type
    )

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