DSCResources/cIntuneDeviceEnrollmentPlatformRestriction/cIntuneDeviceEnrollmentPlatformRestriction.schema.psm1

configuration cIntuneDeviceEnrollmentPlatformRestriction {
    param (
        [Parameter()]
        [hashtable[]]
        $Items
)

<#
IntuneDeviceEnrollmentPlatformRestriction [String] #ResourceName
{
    DisplayName = [string]
    Identity = [string]
    [AccessTokens = [string[]]]
    [AndroidForWorkRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
    [AndroidRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
    [ApplicationId = [string]]
    [ApplicationSecret = [PSCredential]]
    [Assignments = [MSFT_DeviceManagementConfigurationPolicyAssignments[]]]
    [CertificateThumbprint = [string]]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [Description = [string]]
    [DeviceEnrollmentConfigurationType = [string]{ platformRestrictions | singlePlatformRestriction }]
    [Ensure = [string]{ Absent | Present }]
    [IosRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
    [MacOSRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
    [MacRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
    [ManagedIdentity = [bool]]
    [Priority = [UInt32]]
    [PsDscRunAsCredential = [PSCredential]]
    [TenantId = [string]]
    [WindowsHomeSkuRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
    [WindowsMobileRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
    [WindowsRestriction = [MSFT_DeviceEnrollmentPlatformRestriction]]
}
 
#>



    Import-DscResource -ModuleName PSDesiredStateConfiguration
    Import-DscResource -ModuleName Microsoft365DSC

    $dscResourceName = 'IntuneDeviceEnrollmentPlatformRestriction'

    $param = $PSBoundParameters
    $param.Remove("InstanceName")

    $dscParameterKeys = 'Identity, DisplayName' -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)
    }
}