DSCResources/cSCAutoSensitivityLabelPolicy/cSCAutoSensitivityLabelPolicy.schema.psm1
configuration cSCAutoSensitivityLabelPolicy { param ( [Parameter()] [hashtable[]] $Items ) <# SCAutoSensitivityLabelPolicy [String] #ResourceName { Name = [string] [AccessTokens = [string[]]] [AddExchangeLocation = [string[]]] [AddOneDriveLocation = [string[]]] [AddOneDriveLocationException = [string[]]] [AddSharePointLocation = [string[]]] [AddSharePointLocationException = [string[]]] [ApplicationId = [string]] [ApplySensitivityLabel = [string]] [CertificatePassword = [PSCredential]] [CertificatePath = [string]] [CertificateThumbprint = [string]] [Comment = [string]] [Credential = [PSCredential]] [DependsOn = [string[]]] [Ensure = [string]{ Absent | Present }] [ExchangeLocation = [string[]]] [ExchangeSender = [string[]]] [ExchangeSenderException = [string[]]] [ExchangeSenderMemberOf = [string[]]] [ExchangeSenderMemberOfException = [string[]]] [Mode = [string]{ Disable | Enable | TestWithNotifications | TestWithoutNotifications }] [OneDriveLocation = [string[]]] [OneDriveLocationException = [string[]]] [Priority = [UInt32]] [PsDscRunAsCredential = [PSCredential]] [RemoveExchangeLocation = [string[]]] [RemoveOneDriveLocation = [string[]]] [RemoveOneDriveLocationException = [string[]]] [RemoveSharePointLocation = [string[]]] [RemoveSharePointLocationException = [string[]]] [SharePointLocation = [string[]]] [SharePointLocationException = [string[]]] [TenantId = [string]] } #> Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName Microsoft365DSC $dscResourceName = 'SCAutoSensitivityLabelPolicy' $param = $PSBoundParameters $param.Remove("InstanceName") $dscParameterKeys = 'Name' -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) } } |