Public/Permissions/Write-KritTcmLogEntry.ps1

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

.DESCRIPTION
    Auto-scaffolded wave .1514 by New-KritTcmFromM365DscHelpers.ps1.
    Thin delegating passthrough — logic stays in Microsoft365DSC upstream;
    Krit.TCM provides the friendly namespace + citation registration
    for HARD RULE 20 discipline.

    Install-Module Microsoft365DSC -Scope CurrentUser BEFORE calling.

.NOTES
    Wave .1514. Underlying cmdlet: Write-LogEntry
    Category: Permissions
    Module: M365DSCPermissions
    Params: 2
#>

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

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