Public/Logging/Test-KritTcmTransientError.ps1

<#
.SYNOPSIS
    Krit.TCM wrapper over Microsoft365DSC helper Test-M365DSCTransientError
    (category: Logging, module: M365DSCErrorHandler).

.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: Test-M365DSCTransientError
    Category: Logging
    Module: M365DSCErrorHandler
    Params: 1
#>

function Test-KritTcmTransientError {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)] [ErrorRecord] $ErrorRecord
    )

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