Windows Powershell

Command list:

1) Check environment variables. There are several methods to check environment variables:

  • Get-ChildItem -Path Env: # to retrieve all environment variables and values

  • dir env: # to list all environment variables

  • dir env:path # to list specific environment variables (path)

  • $Env:PATH # to list PATH variable

  • $Env:PATH -split ';' # to list PATH variable with all values separated

  • [System.Environment]::GetEnvironmentVariable('PATH','machine') > C:\backup-path.txt # to backup values of PATH variable

2) How to change environment variable: