DSCResources/Resources/windows.RootCertificate.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

$rules = Select-Rule -RuleList $stig.RuleList -Type RootCertificateRule

foreach ($rule in $rules)
{
    if ($rule.CertificateName -match "Interoperability")
    {
        $storeLocation = 'Disallowed'
    }
    else
    {
        $storeLocation = 'Root'
    }

    CertificateImport (Get-ResourceTitle -Rule $rule)
    {
        Thumbprint = $rule.Thumbprint
        Location   = 'LocalMachine'
        Store      = $storeLocation
        Path       = $rule.Location
    }
}