-
Notifications
You must be signed in to change notification settings - Fork 141
/
MSFT_ADKDSKey.config.ps1
44 lines (41 loc) · 1.15 KB
/
MSFT_ADKDSKey.config.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#region HEADER
# Integration Test Config Template Version: 1.2.0
#endregion
$configFile = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, 'json')
if (Test-Path -Path $configFile)
{
<#
Allows reading the configuration data from a JSON file, for real testing
scenarios outside of the CI.
#>
$ConfigurationData = Get-Content -Path $configFile | ConvertFrom-Json
}
else
{
$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'
CertificateFile = $env:DscPublicCertificatePath
EffectiveTime = '01/01/1999 13:00:00'
}
)
}
}
<#
.SYNOPSIS
Create a KDS root key in the past. This will allow the key to be used right away
#>
Configuration MSFT_ADKDSKey_CreateKDSRootKeyInPast_Config
{
Import-DscResource -ModuleName 'ActiveDirectoryDsc'
node $AllNodes.NodeName
{
ADKDSKey 'Integration_Test'
{
Ensure = 'Present'
EffectiveTime = $ConfigurationData.AllNodes.EffectiveTime
AllowUnsafeEffectiveTime = $true
}
}
}