PowerShell: Environment Variable
This page is a tutorial on using PowerShell to view or set environment variables.
For introduction on Microsoft Windows Environment Variables, see: Windows Environment Variable Tutorial .
- Environment variable are stored in Windows Registry. [see Windows: Registry Tutorial]
- When PowerShell starts, it reads the Registry and export them into current session of PowerShell.
Session Environment Variable
Change to environment variable in current session is temporary. Once you exit shell, the changes are gone.
Environment Variable in Registry
Change to environment variable in the registry is permanent.