DSCResources/cSCRetentionCompliancePolicy/cSCRetentionCompliancePolicy.schema.psm1
configuration cSCRetentionCompliancePolicy { param ( [Parameter()] [hashtable[]] $Items ) <# SCRetentionCompliancePolicy [String] #ResourceName { Name = [string] [AccessTokens = [string[]]] [ApplicationId = [string]] [CertificatePassword = [PSCredential]] [CertificatePath = [string]] [CertificateThumbprint = [string]] [Comment = [string]] [Credential = [PSCredential]] [DependsOn = [string[]]] [DynamicScopeLocation = [string[]]] [Enabled = [bool]] [Ensure = [string]{ Absent | Present }] [ExchangeLocation = [string[]]] [ExchangeLocationException = [string[]]] [ModernGroupLocation = [string[]]] [ModernGroupLocationException = [string[]]] [OneDriveLocation = [string[]]] [OneDriveLocationException = [string[]]] [PsDscRunAsCredential = [PSCredential]] [PublicFolderLocation = [string[]]] [RestrictiveRetention = [bool]] [SharePointLocation = [string[]]] [SharePointLocationException = [string[]]] [SkypeLocation = [string[]]] [SkypeLocationException = [string[]]] [TeamsChannelLocation = [string[]]] [TeamsChannelLocationException = [string[]]] [TeamsChatLocation = [string[]]] [TeamsChatLocationException = [string[]]] [TenantId = [string]] } #> Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName Microsoft365DSC $dscResourceName = 'SCRetentionCompliancePolicy' $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) } } |