Public/Utility/Write-KritTcmHost.ps1

<#
.SYNOPSIS
    Krit.TCM wrapper over Microsoft365DSC helper Write-M365DSCHost
    (category: Utility, module: M365DSCUtil).

.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-M365DSCHost
    Category: Utility
    Module: M365DSCUtil
    Params: 4
#>

function Write-KritTcmHost {
    [CmdletBinding()]
    param(
        [String] $Message,
        [ConsoleColor] $ForegroundColor,
        [SwitchParameter] $DeferWrite,
        [SwitchParameter] $CommitWrite
    )

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