Last Updated: November 05, 2022
·
2.389K
· arnaudm

How to use ENV vars in Windows Powershell

You're using the Windows Powershell but you miss %HOMEPATH% ?

Use $env:HOMEPATH

e.g.

PS C:\> echo $env:HOMEPATH
\Users\arnaud

Works for any environment variable of course.

List ENV with: Get-ChildItem -path env:

(just type get-c + [TAB])