PowerShell: Set environment variable

Spread the love

It’s very simply task.

Just use next command:

$env:TEST = "test_value"

where TEST is a name of environment variable and test_value – value for this variable.

If you want to check, use

Get-Item Env:your_env_var_name

or

Get-ChildItem Env:

if you want to get all environment variables.

Leave a Reply