DSCResources/cTeamsUserPolicyAssignment/cTeamsUserPolicyAssignment.schema.psm1
configuration cTeamsUserPolicyAssignment { param ( [Parameter()] [hashtable[]] $Items ) <# TeamsUserPolicyAssignment [String] #ResourceName { User = [string] [AccessTokens = [string[]]] [ApplicationId = [string]] [CallingLineIdentity = [string]] [CertificateThumbprint = [string]] [Credential = [PSCredential]] [DependsOn = [string[]]] [ExternalAccessPolicy = [string]] [ManagedIdentity = [bool]] [OnlineVoicemailPolicy = [string]] [OnlineVoiceRoutingPolicy = [string]] [PsDscRunAsCredential = [PSCredential]] [TeamsAppPermissionPolicy = [string]] [TeamsAppSetupPolicy = [string]] [TeamsAudioConferencingPolicy = [string]] [TeamsCallHoldPolicy = [string]] [TeamsCallingPolicy = [string]] [TeamsCallParkPolicy = [string]] [TeamsChannelsPolicy = [string]] [TeamsEmergencyCallingPolicy = [string]] [TeamsEmergencyCallRoutingPolicy = [string]] [TeamsEnhancedEncryptionPolicy = [string]] [TeamsEventsPolicy = [string]] [TeamsMeetingBroadcastPolicy = [string]] [TeamsMeetingPolicy = [string]] [TeamsMessagingPolicy = [string]] [TeamsMobilityPolicy = [string]] [TeamsUpdateManagementPolicy = [string]] [TeamsUpgradePolicy = [string]] [TenantDialPlan = [string]] [TenantId = [string]] } #> Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName Microsoft365DSC $dscResourceName = 'TeamsUserPolicyAssignment' $param = $PSBoundParameters $param.Remove("InstanceName") $dscParameterKeys = 'User' -split ', ' foreach ($item in $Items) { $keyValues = foreach ($key in $dscParameterKeys) { $item.$key } $executionName = $keyValues -join '_' $executionName = $executionName -replace "[\s()\\:*-+/{}```"']", '_' (Get-DscSplattedResource -ResourceName $dscResourceName -ExecutionName $executionName -Properties $item -NoInvoke).Invoke($item) } } |