DSCResources/cTeamsMessagingPolicy/cTeamsMessagingPolicy.schema.psm1
configuration cTeamsMessagingPolicy { param ( [Parameter()] [hashtable[]] $Items ) <# TeamsMessagingPolicy [String] #ResourceName { Identity = [string] [AccessTokens = [string[]]] [AllowCommunicationComplianceEndUserReporting = [bool]] [AllowFluidCollaborate = [bool]] [AllowGiphy = [bool]] [AllowImmersiveReader = [bool]] [AllowMemes = [bool]] [AllowOwnerDeleteMessage = [bool]] [AllowPriorityMessages = [bool]] [AllowRemoveUser = [bool]] [AllowSecurityEndUserReporting = [bool]] [AllowSmartCompose = [bool]] [AllowSmartReply = [bool]] [AllowStickers = [bool]] [AllowUrlPreviews = [bool]] [AllowUserChat = [bool]] [AllowUserDeleteChat = [bool]] [AllowUserDeleteMessage = [bool]] [AllowUserEditMessage = [bool]] [AllowUserTranslation = [bool]] [AllowVideoMessages = [bool]] [ApplicationId = [string]] [AudioMessageEnabledType = [string]{ ChatsAndChannels | ChatsOnly | Disabled }] [CertificateThumbprint = [string]] [ChannelsInChatListEnabledType = [string]{ DisabledUserOverride | EnabledUserOverride }] [Credential = [PSCredential]] [DependsOn = [string[]]] [Description = [string]] [Ensure = [string]{ Absent | Present }] [GiphyRatingType = [string]{ MODERATE | NORESTRICTION | STRICT }] [ManagedIdentity = [bool]] [PsDscRunAsCredential = [PSCredential]] [ReadReceiptsEnabledType = [string]{ Everyone | None | UserPreference }] [Tenant = [string]] [TenantId = [string]] } #> Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName Microsoft365DSC $dscResourceName = 'TeamsMessagingPolicy' $param = $PSBoundParameters $param.Remove("InstanceName") $dscParameterKeys = 'Identity' -split ', ' foreach ($item in $Items) { if (-not $item.ContainsKey('Ensure')) { $item.Ensure = 'Present' } $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) } } |