Public/Intune/ConvertTo-KritTcmIntunePolicyAssignment.ps1

<#
.SYNOPSIS
    Krit.TCM wrapper over Microsoft365DSC helper ConvertTo-IntunePolicyAssignment
    (category: Intune, module: M365DSCIntuneUtil).

.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: ConvertTo-IntunePolicyAssignment
    Category: Intune
    Module: M365DSCIntuneUtil
    Params: 2
#>

function ConvertTo-KritTcmIntunePolicyAssignment {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)] [Object] $Assignments,
        [Boolean] $IncludeDeviceFilter
    )

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