Powershell - changing the value of an environment variable

Is there a way to change the value of an environment (system) variable via powershell? I was only able to change the value manually and see the change after restarting powershell. Context: we are trying to dynamically set the value of the indirect SSIS configuration, and the configuration file is different for the environment.

+6
source share
1 answer

To set the environment variable at the system level (and make it constant), you need to use the .Net Framework [Environment]::SetEnvironmentVariable() method

In the current session, you can set them via $env:NAME = VALUE .

See http://technet.microsoft.com/en-us/library/ff730964.aspx

+9
source

All Articles