DSC resource for managing environment variables.
Carbon_EnvironmentVariable [String] #ResourceName
{
Name = [string]
[DependsOn = [string[]]]
[Ensure = [string]{ Absent | Present }]
[PsDscRunAsCredential = [PSCredential]]
[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.
Carbon_EnvironmentVariable
is new in Carbon 2.0.
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 |
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';
}