Public/Graph/Set-KriticalUtcmMgUserLicense.ps1
|
<# .SYNOPSIS Kritical.UTCM wrapper over Microsoft365DSC helper Set-MgUserLicense (category: Graph, module: M365DSCGraphShim). .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: Graph Module: M365DSCGraphShim Params: 14 #> function Set-KriticalUtcmMgUserLicense { [CmdletBinding()] param( [String] $UserId, [Object] $InputObject, [Object] $BodyParameter, [String] $ResponseHeadersVariable, [Object] $AddLicenses, [Hashtable] $AdditionalProperties, [String[]] $RemoveLicenses, [SwitchParameter] $Break, [IDictionary] $Headers, [Object[]] $HttpPipelineAppend, [Object[]] $HttpPipelinePrepend, [Uri] $Proxy, [PSCredential] $ProxyCredential, [SwitchParameter] $ProxyUseDefaultCredentials ) if (-not (Get-Command -Name 'Set-MgUserLicense' -ErrorAction SilentlyContinue)) { throw '[KriticalUtcm] Set-MgUserLicense not available — Install-Module Microsoft365DSC -Scope CurrentUser then re-run' } try { & 'Set-MgUserLicense' @PSBoundParameters } catch { Write-Error ('[KriticalUtcm/Set-KriticalUtcmMgUserLicense] ' + 'Set-MgUserLicense' + ' failed: ' + $_.Exception.Message) throw } } |