DSCResources/cIntuneDeviceConfigurationPolicyAndroidWorkProfile/cIntuneDeviceConfigurationPolicyAndroidWorkProfile.schema.psm1

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

<#
IntuneDeviceConfigurationPolicyAndroidWorkProfile [String] #ResourceName
{
    DisplayName = [string]
    [AccessTokens = [string[]]]
    [ApplicationId = [string]]
    [ApplicationSecret = [PSCredential]]
    [Assignments = [MSFT_DeviceManagementConfigurationPolicyAssignments[]]]
    [CertificateThumbprint = [string]]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [Description = [string]]
    [Ensure = [string]{ Absent | Present }]
    [ManagedIdentity = [bool]]
    [PasswordBlockFaceUnlock = [bool]]
    [PasswordBlockFingerprintUnlock = [bool]]
    [PasswordBlockIrisUnlock = [bool]]
    [passwordBlockTrustAgents = [bool]]
    [PasswordExpirationDays = [UInt32]]
    [PasswordMinimumLength = [UInt32]]
    [PasswordMinutesOfInactivityBeforeScreenTimeout = [UInt32]]
    [PasswordPreviousPasswordBlockCount = [UInt32]]
    [PasswordRequiredType = [string]{ alphanumericWithSymbols | atLeastAlphabetic | atLeastAlphanumeric | atLeastNumeric | deviceDefault | lowSecurityBiometric | numericComplex | required }]
    [PasswordSignInFailureCountBeforeFactoryReset = [UInt32]]
    [PsDscRunAsCredential = [PSCredential]]
    [RequiredPasswordComplexity = [string]{ high | low | medium | none }]
    [SecurityRequireVerifyApps = [bool]]
    [TenantId = [string]]
    [VpnAlwaysOnPackageIdentifier = [string]]
    [VpnEnableAlwaysOnLockdownMode = [bool]]
    [WorkProfileAllowAppInstallsFromUnknownSources = [bool]]
    [WorkProfileAllowWidgets = [bool]]
    [WorkProfileBlockAddingAccounts = [bool]]
    [WorkProfileBlockCamera = [bool]]
    [WorkProfileBlockCrossProfileCallerId = [bool]]
    [WorkProfileBlockCrossProfileContactsSearch = [bool]]
    [WorkProfileBlockCrossProfileCopyPaste = [bool]]
    [WorkProfileBlockNotificationsWhileDeviceLocked = [bool]]
    [WorkProfileBlockPersonalAppInstallsFromUnknownSources = [bool]]
    [WorkProfileBlockScreenCapture = [bool]]
    [WorkProfileBluetoothEnableContactSharing = [bool]]
    [WorkProfileDataSharingType = [string]{ allowPersonalToWork | deviceDefault | noRestrictions | preventAny }]
    [WorkProfileDefaultAppPermissionPolicy = [string]{ autoDeny | autoGrant | deviceDefault | prompt }]
    [WorkProfilePasswordBlockFaceUnlock = [bool]]
    [WorkProfilePasswordBlockFingerprintUnlock = [bool]]
    [WorkProfilePasswordBlockIrisUnlock = [bool]]
    [WorkProfilePasswordBlockTrustAgents = [bool]]
    [WorkProfilePasswordExpirationDays = [UInt32]]
    [WorkProfilePasswordMinimumLength = [UInt32]]
    [WorkProfilePasswordMinLetterCharacters = [UInt32]]
    [WorkProfilePasswordMinLowerCaseCharacters = [UInt32]]
    [WorkProfilePasswordMinNonLetterCharacters = [UInt32]]
    [WorkProfilePasswordMinNumericCharacters = [UInt32]]
    [WorkProfilePasswordMinSymbolCharacters = [UInt32]]
    [WorkProfilePasswordMinUpperCaseCharacters = [UInt32]]
    [WorkProfilePasswordMinutesOfInactivityBeforeScreenTimeout = [UInt32]]
    [WorkProfilePasswordPreviousPasswordBlockCount = [UInt32]]
    [WorkProfilePasswordRequiredType = [string]{ alphanumericWithSymbols | atLeastAlphabetic | atLeastAlphanumeric | atLeastNumeric | deviceDefault | lowSecurityBiometric | numericComplex | required }]
    [WorkProfilePasswordSignInFailureCountBeforeFactoryReset = [UInt32]]
    [WorkProfileRequiredPasswordComplexity = [string]{ high | low | medium | none }]
    [WorkProfileRequirePassword = [bool]]
}
 
#>



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

    $dscResourceName = 'IntuneDeviceConfigurationPolicyAndroidWorkProfile'

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

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