Public/Report/New-KriticalUtcmWorkloadSection.ps1

<#
.SYNOPSIS
    Kritical.UTCM wrapper over Microsoft365DSC helper New-M365DSCWorkloadSection
    (category: Report, module: M365DSCReport).

.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: Report
    Module: M365DSCReport
    Params: 2
#>

function New-KriticalUtcmWorkloadSection {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)] [Array] $Resources,
        [Parameter(Mandatory)] [ScriptBlock] $ResourceRenderer
    )

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