Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

PowerShell: Viewing Environment Variables

📅 2011-Oct-29 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ environment variables, powershell ⬩ 📚 Archive

In the Windows command prompt, environment variables could be viewed by using the set command. In PowerShell, all the environment variables are available on a PowerShell drive named Env:

To list all the environment variables and their values:

$ Get-ChildItem Env:
$ dir Env:

To display the value of a specific environment variable, for example the PATH environment variable:

$ $Env:PATH

Tried with: PowerShell 2.0