powershell add path to environment variable code example
Example 1: powershell set environment variable
# Windows PowerShell
PS C:\> $env:VAR_NAME="VALUE"
Example 2: add to path windows powershell
$env:Path = "SomeRandomPath"; (replaces existing path)
$env:Path += ";SomeRandomPath" (appends to existing path)
Example 3: add to path windows powershell
setx PATH "$env:path;\the\directory\to\add" -m