Examples/Sample_RegistryResource_AddKey.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<#
    .SYNOPSIS
        Create a new registry key called MyNewKey as a subkey under the key
        'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'.
#>

Configuration Sample_RegistryResource_AddKey
{
    Import-DscResource -ModuleName 'PSDscResources'

    Node localhost
    {
        Registry Registry1
        {
            Key = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\MyNewKey'
            Ensure = 'Present'
            ValueName = ''
        }
    }
}