Examples/Sample_xEnvironment_CreateNonPathVariable.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
<#
    .SYNOPSIS
        Creates the environment variable 'TestEnvironmentVariable' and sets the value to 'TestValue'
        both on the machine and within the process.
#>

Configuration Sample_xEnvironment_CreateNonPathVariable 
{
    param ()

    Import-DscResource -ModuleName 'xPSDesiredStateConfiguration'

    Node localhost
    {
        xEnvironment CreateEnvironmentVariable
        {
            Name = 'TestEnvironmentVariable'
            Value = 'TestValue'
            Ensure = 'Present'
            Path = $false
            Target = @('Process', 'Machine')
        }
    }
}

Sample_xEnvironment_CreateNonPathVariable