DSCResources/cIntuneAntivirusPolicyWindows10SettingCatalog/cIntuneAntivirusPolicyWindows10SettingCatalog.schema.psm1

configuration cIntuneAntivirusPolicyWindows10SettingCatalog {
    param (
        [Parameter()]
        [hashtable[]]
        $Items,
        [Parameter()]
        [string]
        $TenantId,

        [Parameter()]
        [bool]
        $ManagedIdentity,

        [Parameter()]
        [pscredential]
        $Credential,

        [Parameter()]
        [string]
        $CertificateThumbprint,

        [Parameter()]
        [pscredential]
        $ApplicationSecret,

        [Parameter()]
        [string]
        $ApplicationId,

        [Parameter()]
        [string[]]
        $AccessTokens
)

<#
IntuneAntivirusPolicyWindows10SettingCatalog [String] #ResourceName
{
    DisplayName = [string]
    [AccessTokens = [string[]]]
    [AllowArchiveScanning = [Int32]{ 0 | 1 }]
    [AllowBehaviorMonitoring = [Int32]{ 0 | 1 }]
    [AllowCloudProtection = [Int32]{ 0 | 1 }]
    [AllowDatagramProcessingOnWinServer = [Int32]{ 0 | 1 }]
    [AllowEmailScanning = [Int32]{ 0 | 1 }]
    [AllowFullScanOnMappedNetworkDrives = [Int32]{ 0 | 1 }]
    [AllowFullScanRemovableDriveScanning = [Int32]{ 0 | 1 }]
    [AllowIntrusionPreventionSystem = [Int32]{ 0 | 1 }]
    [AllowIOAVProtection = [Int32]{ 0 | 1 }]
    [AllowNetworkProtectionDownLevel = [Int32]{ 0 | 1 }]
    [AllowOnAccessProtection = [Int32]{ 0 | 1 }]
    [AllowRealtimeMonitoring = [Int32]{ 0 | 1 }]
    [AllowScanningNetworkFiles = [Int32]{ 0 | 1 }]
    [AllowScriptScanning = [Int32]{ 0 | 1 }]
    [AllowUserUIAccess = [Int32]{ 0 | 1 }]
    [ApplicationId = [string]]
    [ApplicationSecret = [PSCredential]]
    [ArchiveMaxDepth = [Int32]]
    [ArchiveMaxSize = [Int32]]
    [Assignments = [MSFT_DeviceManagementConfigurationPolicyAssignments[]]]
    [AvgCPULoadFactor = [Int32]]
    [CertificatePassword = [PSCredential]]
    [CertificatePath = [string]]
    [CertificateThumbprint = [string]]
    [CheckForSignaturesBeforeRunningScan = [Int32]{ 0 | 1 }]
    [CloudBlockLevel = [Int32]{ 0 | 2 | 4 | 6 }]
    [CloudExtendedTimeout = [Int32]]
    [CompanyName = [string]]
    [ControlledConfiguration = [string]{ ControlledConfig_Onboarding | Offboarding | Onboarding }]
    [Credential = [PSCredential]]
    [DaysToRetainCleanedMalware = [Int32]]
    [DependsOn = [string[]]]
    [Description = [string]]
    [DisableAccountProtectionUI = [Int32]{ 0 | 1 }]
    [DisableAppBrowserUI = [Int32]{ 0 | 1 }]
    [DisableCatchupFullScan = [Int32]{ 0 | 1 }]
    [DisableCatchupQuickScan = [Int32]{ 0 | 1 }]
    [DisableClearTpmButton = [Int32]{ 0 | 1 }]
    [DisableCoreServiceECSIntegration = [Int32[]]{ 0 | 1 }]
    [DisableCoreServiceTelemetry = [Int32[]]{ 0 | 1 }]
    [DisableDeviceSecurityUI = [Int32]{ 0 | 1 }]
    [DisableDnsOverTcpParsing = [Int32]{ 0 | 1 }]
    [DisableEnhancedNotifications = [Int32]{ 0 | 1 }]
    [DisableFamilyUI = [Int32]{ 0 | 1 }]
    [DisableHealthUI = [Int32]{ 0 | 1 }]
    [DisableHttpParsing = [Int32]{ 0 | 1 }]
    [DisableLocalAdminMerge = [Int32]{ 0 | 1 }]
    [DisableNetworkUI = [Int32]{ 0 | 1 }]
    [DisableSshParsing = [Int32]{ 0 | 1 }]
    [DisableTlsParsing = [Int32]{ 0 | 1 }]
    [DisableTpmFirmwareUpdateWarning = [Int32]{ 0 | 1 }]
    [DisableVirusUI = [Int32]{ 0 | 1 }]
    [Email = [string]]
    [EnableCustomizedToasts = [Int32]{ 0 | 1 }]
    [EnableInAppCustomization = [Int32]{ 0 | 1 }]
    [EnableLowCPUPriority = [Int32]{ 0 | 1 }]
    [EnableNetworkProtection = [Int32]{ 0 | 1 | 2 }]
    [EngineUpdatesChannel = [Int32]{ 0 | 2 | 3 | 4 | 5 | 6 }]
    [Ensure = [string]{ Absent | Present }]
    [ExcludedExtensions = [string[]]]
    [ExcludedPaths = [string[]]]
    [ExcludedProcesses = [string[]]]
    [HideRansomwareDataRecovery = [Int32]{ 0 | 1 }]
    [HideWindowsSecurityNotificationAreaControl = [Int32]{ 0 | 1 }]
    [HighSeverityThreats = [string]{ allow | block | clean | quarantine | remove | userdefined }]
    [Identity = [string]]
    [LowSeverityThreats = [string]{ allow | block | clean | quarantine | remove | userdefined }]
    [ManagedIdentity = [bool]]
    [MeteredConnectionUpdates = [string]{ 0 | 1 }]
    [ModerateSeverityThreats = [string]{ allow | block | clean | quarantine | remove | userdefined }]
    [Phone = [string]]
    [PlatformUpdatesChannel = [Int32]{ 0 | 2 | 3 | 4 | 5 | 6 }]
    [PsDscRunAsCredential = [PSCredential]]
    [PUAProtection = [Int32]{ 0 | 1 | 2 }]
    [RandomizeScheduleTaskTimes = [Int32]{ 0 | 1 }]
    [RealTimeScanDirection = [Int32]{ 0 | 1 | 2 }]
    [RoleScopeTagIds = [string[]]]
    [ScanParameter = [Int32]{ 1 | 2 }]
    [ScheduleQuickScanTime = [Int32]]
    [SchedulerRandomizationTime = [Int32]]
    [ScheduleScanDay = [Int32]{ 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 }]
    [ScheduleScanTime = [Int32]]
    [SecurityIntelligenceUpdatesChannel = [Int32]{ 0 | 4 | 5 }]
    [SevereThreats = [string]{ allow | block | clean | quarantine | remove | userdefined }]
    [SignatureUpdateFallbackOrder = [string[]]]
    [SignatureUpdateFileSharesSources = [string[]]]
    [SignatureUpdateInterval = [Int32]]
    [SubmitSamplesConsent = [Int32]{ 0 | 1 | 2 | 3 }]
    [TamperProtection = [string]{ Offboarding | Onboarding }]
    [TemplateId = [string]{ 45fea5e9-280d-4da1-9792-fb5736da0ca9_1 | 804339ad-1553-4478-a742-138fb5807418_1 | d948ff9b-99cb-4ee0-8012-1fbc09685377_1 | e3f74c5a-a6de-411d-aef6-eb15628f3a0a_1 }]
    [TenantId = [string]]
    [URL = [string]]
}
 
#>



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

    $dscResourceName = 'IntuneAntivirusPolicyWindows10SettingCatalog'

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

    $dscParameterKeys = 'DisplayName' -split ', '

        foreach ($item in $Items)
        {
            if (-not $item.ContainsKey('Ensure'))
            {
                $item.Ensure = 'Present'
            }

            if (-not $item.ContainsKey('TenantId') -and $param.ContainsKey('TenantId'))
            {
                $item.TenantId = $TenantId
            }

            if (-not $item.ContainsKey('ManagedIdentity') -and $param.ContainsKey('ManagedIdentity'))
            {
                $item.ManagedIdentity = $ManagedIdentity
            }

            if (-not $item.ContainsKey('Credential') -and $param.ContainsKey('Credential'))
            {
                $item.Credential = $Credential
            }

            if (-not $item.ContainsKey('CertificateThumbprint') -and $param.ContainsKey('CertificateThumbprint'))
            {
                $item.CertificateThumbprint = $CertificateThumbprint
            }

            if (-not $item.ContainsKey('ApplicationSecret') -and $param.ContainsKey('ApplicationSecret'))
            {
                $item.ApplicationSecret = $ApplicationSecret
            }

            if (-not $item.ContainsKey('ApplicationId') -and $param.ContainsKey('ApplicationId'))
            {
                $item.ApplicationId = $ApplicationId
            }

            if (-not $item.ContainsKey('AccessTokens') -and $param.ContainsKey('AccessTokens'))
            {
                $item.AccessTokens = $AccessTokens
            }
            $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)
    }
}