DSC resource for managing environment variables.
Carbon_EnvironmentVariable [string] #ResourceName
{
Name = [string]
[ DependsOn = [string[]] ]
[ Ensure = [string] { Absent | Present } ]
[ Value = [string] ]
}
The Carbon_EnvironmentVariable resource will add, update, or remove environment variables. The environment variable is set/removed at both the computer and process level, so that the process applying the DSC configuration will have access to the variable in later resources.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | The name of the environment variable. | true | false | |
Value | String | The value of the environment variable. | false | false | |
Ensure | String | Set to Present to create the environment variable. Set to Absent to delete it. |
false | false | Present |
Demonstrates how to create or update an environment variable:
Carbon_EnvironmentVariable SetCarbonEnv
{
Name = 'CARBON_ENV';
Value = 'developer';
Ensure = 'Present';
}
Demonstrates how to remove an environment variable.
Carbon_EnvironmentVariable RemoveCarbonEnv
{
Name = 'CARBON_ENV';
Ensure = 'Absent';
}