I'm starting to use PowerShell and am trying to figure out how to echo
a system environment variable to the console to read it.
Neither of the below are working. The first just prints %PATH%
, and the second prints nothing.
echo %PATH%
echo $PATH
I'm starting to use PowerShell and am trying to figure out how to echo
a system environment variable to the console to read it.
Neither of the below are working. The first just prints %PATH%
, and the second prints nothing.
echo %PATH%
echo $PATH
In addition to Mathias answer.
Although not mentioned in OP, if you also need to see the Powershell specific/related internal variables, you need to use
Get-Variable
:These also include stuff you may have set in your profile startup script.
Prefix the variable name with
env
:You can also enumerate all variables via the
env
drive: