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


Get-ChildItem Env:

if you want to get all environment variables.

Leave a Reply