DSCResources/cAADCrossTenantAccessPolicy/cAADCrossTenantAccessPolicy.schema.psm1
configuration cAADCrossTenantAccessPolicy { param ( [Parameter(Mandatory = $true)] [ValidateSet('Yes')] [string] $IsSingleInstance, [Parameter()] [string] $DisplayName, [Parameter()] [ValidateSet('microsoftonline.com', 'microsoftonline.us', 'partner.microsoftonline.cn')] [string[]] $AllowedCloudEndpoints, [Parameter()] [ValidateSet('Present')] [string] $Ensure, [Parameter()] [PSCredential] $Credential, [Parameter()] [string] $ApplicationId, [Parameter()] [string] $TenantId, [Parameter()] [PSCredential] $ApplicationSecret, [Parameter()] [string] $CertificateThumbprint, [Parameter()] [bool] $ManagedIdentity, [Parameter()] [string[]] $AccessTokens ) <# AADCrossTenantAccessPolicy [String] #ResourceName { IsSingleInstance = [string]{ Yes } [AccessTokens = [string[]]] [AllowedCloudEndpoints = [string[]]{ microsoftonline.com | microsoftonline.us | partner.microsoftonline.cn }] [ApplicationId = [string]] [ApplicationSecret = [PSCredential]] [CertificateThumbprint = [string]] [Credential = [PSCredential]] [DependsOn = [string[]]] [DisplayName = [string]] [Ensure = [string]{ Present }] [ManagedIdentity = [bool]] [PsDscRunAsCredential = [PSCredential]] [TenantId = [string]] } #> Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName Microsoft365DSC $dscResourceName = 'AADCrossTenantAccessPolicy' $param = $PSBoundParameters $param.Remove("InstanceName") $dscParameterKeys = 'IsSingleInstance' -split ', ' $keyValues = foreach ($key in $dscParameterKeys) { $param.$key } $executionName = $keyValues -join '_' $executionName = $executionName -replace "[\s()\\:*-+/{}```"']", '_' (Get-DscSplattedResource -ResourceName $dscResourceName -ExecutionName $executionName -Properties $param -NoInvoke).Invoke($param) } |