powershell print environment variable code example
Example 1: powershell set environment variable
# Windows PowerShell
PS C:\> $env:VAR_NAME="VALUE"
Example 2: powershell print environment variables
#pws
$Env:path
Get-ChildItem env
Example 3: how to get environment variables in powershell
#Windows Powershell
cd Env:
Get-ChildItem
Example 4: powershell environment variables set
$Env:<variable-name> = "<new-value>"