PowerShell environment provider - $env
Windows PowerShell has a built in environment provider ($env) which will help you to access all the environment variables on a computer.
Interested to know what’s in your PATH system environment variable?
Type this :
$path = $env:path
$path
To view all the environment variables and their values use this command
dir env:
As you can see, here we leave off the $ and reference the env: drive instead.