powershell set system variable for all sessions code example Example: powershell set environment variable # Windows PowerShell PS C:\> $env:VAR_NAME="VALUE"