Public/Export/Get-KriticalUtcmRelationTargetKey.ps1

<#
.SYNOPSIS
    Kritical.UTCM wrapper over Microsoft365DSC helper Get-M365DSCRelationTargetKey
    (category: Export, module: M365DSCExportUtil).

.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: Export
    Module: M365DSCExportUtil
    Params: 2
#>

function Get-KriticalUtcmRelationTargetKey {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)] [Object] $Item,
        [Parameter(Mandatory)] [Object] $Relation
    )

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