PoshTip #4 – List all environment variables
Retrieving the list of current environment variables is very simply with PowerShell. The windows environment variables are mounted as PSDrive in PowerShell.
Just run :
You can use Get-Item to get the value of desired environment variable. Below, I get the current username :
You can also list all the variables :