How can I display environment variables in PowerShell, and be able to distinguish between which ones are "user" vars and which ones are "system" vars?

link|improve this question
feedback

2 Answers

Not a powershell pro, but at worst, you could go fish around in the registry to see whether the vars you're interested in are showing up there. Inside a given session, I'm not really sure there's any distinction between user/sys vars other than the registry storage location...

Pertinent keys are:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
HKEY_CURRENT_USER\Environment
link|improve this answer
1  
Correct: in process there is no distinction. And of course PATH is a combination of system and user settings so as set is neither. – Richard Apr 6 '11 at 8:06
feedback

To find out within PowerShell:

Get-ItemProperty -Path 'Registry::HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'

Get-ItemProperty -Path 'Registry::HKCU\Environment'
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.