Skip to content

Instantly share code, notes, and snippets.

@hugefiver
Created December 30, 2021 06:39
Show Gist options
  • Save hugefiver/974d56248cb82d8d861b487e982780ba to your computer and use it in GitHub Desktop.
Save hugefiver/974d56248cb82d8d861b487e982780ba to your computer and use it in GitHub Desktop.
get envs
# machine
$path = [Environment]::GetEnvironmentVariable('ENV_NAME', 'Machine')
[Environment]::SetEnvironmentVariable("ENV_NAME", $newpath, 'Machine')
# user
$path = [Environment]::GetEnvironmentVariable('ENV_NAME', 'User')
[Environment]::SetEnvironmentVariable("ENV_NAME", $newpath, 'USer')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment