DSCResources/cIntuneDeviceConfigurationPolicyMacOS/cIntuneDeviceConfigurationPolicyMacOS.schema.psm1

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

<#
IntuneDeviceConfigurationPolicyMacOS [String] #ResourceName
{
    DisplayName = [string]
    [AccessTokens = [string[]]]
    [AddingGameCenterFriendsBlocked = [bool]]
    [AirDropBlocked = [bool]]
    [AppleWatchBlockAutoUnlock = [bool]]
    [ApplicationId = [string]]
    [ApplicationSecret = [PSCredential]]
    [Assignments = [MSFT_DeviceManagementConfigurationPolicyAssignments[]]]
    [CameraBlocked = [bool]]
    [CertificateThumbprint = [string]]
    [ClassroomAppBlockRemoteScreenObservation = [bool]]
    [ClassroomAppForceUnpromptedScreenObservation = [bool]]
    [ClassroomForceAutomaticallyJoinClasses = [bool]]
    [ClassroomForceRequestPermissionToLeaveClasses = [bool]]
    [ClassroomForceUnpromptedAppAndDeviceLock = [bool]]
    [CompliantAppListType = [string]{ appsInListCompliant | appsNotInListCompliant | none }]
    [CompliantAppsList = [MSFT_MicrosoftGraphapplistitemMacOS[]]]
    [ContentCachingBlocked = [bool]]
    [Credential = [PSCredential]]
    [DefinitionLookupBlocked = [bool]]
    [DependsOn = [string[]]]
    [Description = [string]]
    [EmailInDomainSuffixes = [string[]]]
    [Ensure = [string]{ Absent | Present }]
    [EraseContentAndSettingsBlocked = [bool]]
    [GameCenterBlocked = [bool]]
    [ICloudBlockActivityContinuation = [bool]]
    [ICloudBlockAddressBook = [bool]]
    [ICloudBlockBookmarks = [bool]]
    [ICloudBlockCalendar = [bool]]
    [ICloudBlockDocumentSync = [bool]]
    [ICloudBlockMail = [bool]]
    [ICloudBlockNotes = [bool]]
    [ICloudBlockPhotoLibrary = [bool]]
    [ICloudBlockReminders = [bool]]
    [ICloudDesktopAndDocumentsBlocked = [bool]]
    [ICloudPrivateRelayBlocked = [bool]]
    [Id = [string]]
    [ITunesBlockFileSharing = [bool]]
    [ITunesBlockMusicService = [bool]]
    [KeyboardBlockDictation = [bool]]
    [KeychainBlockCloudSync = [bool]]
    [ManagedIdentity = [bool]]
    [MultiplayerGamingBlocked = [bool]]
    [PasswordBlockAirDropSharing = [bool]]
    [PasswordBlockAutoFill = [bool]]
    [PasswordBlockFingerprintUnlock = [bool]]
    [PasswordBlockModification = [bool]]
    [PasswordBlockProximityRequests = [bool]]
    [PasswordBlockSimple = [bool]]
    [PasswordExpirationDays = [UInt32]]
    [PasswordMaximumAttemptCount = [UInt32]]
    [PasswordMinimumCharacterSetCount = [UInt32]]
    [PasswordMinimumLength = [UInt32]]
    [PasswordMinutesOfInactivityBeforeLock = [UInt32]]
    [PasswordMinutesOfInactivityBeforeScreenTimeout = [UInt32]]
    [PasswordMinutesUntilFailedLoginReset = [UInt32]]
    [PasswordPreviousPasswordBlockCount = [UInt32]]
    [PasswordRequired = [bool]]
    [PasswordRequiredType = [string]{ alphanumeric | deviceDefault | numeric }]
    [PrivacyAccessControls = [MSFT_MicrosoftGraphmacosprivacyaccesscontrolitem[]]]
    [PsDscRunAsCredential = [PSCredential]]
    [SafariBlockAutofill = [bool]]
    [ScreenCaptureBlocked = [bool]]
    [SoftwareUpdateMajorOSDeferredInstallDelayInDays = [UInt32]]
    [SoftwareUpdateMinorOSDeferredInstallDelayInDays = [UInt32]]
    [SoftwareUpdateNonOSDeferredInstallDelayInDays = [UInt32]]
    [SoftwareUpdatesEnforcedDelayInDays = [UInt32]]
    [SpotlightBlockInternetResults = [bool]]
    [TenantId = [string]]
    [TouchIdTimeoutInHours = [UInt32]]
    [UpdateDelayPolicy = [string[]]{ delayAppUpdateVisibility | delayMajorOsUpdateVisibility | delayOSUpdateVisibility | none | unknownFutureValue }]
    [WallpaperModificationBlocked = [bool]]
}
 
#>



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

    $dscResourceName = 'IntuneDeviceConfigurationPolicyMacOS'

    $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)
    }
}