Examples/Resources/IntuneEpmElevationRulesPolicyWindows10/1-Create.ps1

<#
This example creates a new Intune Firewall Policy for Windows10.
#>


Configuration Example
{
    param(
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )
    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        IntuneEpmElevationRulesPolicyWindows10 'Example'
        {
            Assignments           = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    dataType = '#microsoft.graph.groupAssignmentTarget'
                    groupId = '11111111-1111-1111-1111-111111111111'
                }
            );
            Description                 = 'Description'
            DisplayName                 = "IntuneEpmElevationRulesPolicyWindows10_1";
            ElevationRuleName     = @(
                MSFT_MicrosoftGraphIntuneSettingsCatalogElevationRuleName{
                    ChildProcessBehavior = "allowrunelevated"
                    FilePath = "C:\temp"
                    FileVersion = "1.1.1.1"
                    CertificateType = "publisher"
                    FileDescription = "File Description"
                    Elevationtype = "self"
                    FileName = "file.exe"
                    ElevationTypeValidation = @(
                        1
                        2
                    )
                    Name = "Rule name"
                    RestrictArguments = "allow"
                    Description = "Description"
                    CertificatePayloadWithReusableSetting = "IntuneEpmCertificatePolicySetting_1"
                    AppliesTo = "allusers"
                    ProductName = "Product name"
                    InternalName = "Internal name"
                    SignatureSource = 0
                }
                MSFT_MicrosoftGraphIntuneSettingsCatalogElevationRuleName{
                    ChildProcessBehavior = "allowrunelevatedrulerequired"
                    CertificateType = "issuingauthority"
                    Elevationtype = "automatic"
                    FileName = "file2.exe"
                    Name = "Rule 2"
                    CertificatePayloadWithReusableSetting = "IntuneEpmCertificatePolicySetting_1"
                    AppliesTo = "allusers"
                    SignatureSource = 0
                }
            );
            Ensure                      = "Present";
            Id                          = '00000000-0000-0000-0000-000000000000'
            RoleScopeTagIds             = @("0");
            ApplicationId               = $ApplicationId;
            TenantId                    = $TenantId;
            CertificateThumbprint       = $CertificateThumbprint;
        }
    }
}