0

Why does the registry provider not show any entries for the environment? I am using "Run as Administrator". No items are returned from Get-ChildItem. What am I missing?

PS C:\src\t> ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] “Administrator”)
True
PS C:\src\t> Set-Location 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\'
PS HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\> Get-ChildItem
PS HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\>
4
  • 1
    Try Get-ItemProperty. Commented Jun 20, 2017 at 21:04
  • Ok. I see it. Path is a property of Environment. It would just seem logical that the provider would present Path as a child item of Environment. Commented Jun 20, 2017 at 21:09
  • (Get-ItemProperty .).Path Commented Jun 20, 2017 at 21:15
  • Use GCI Env: for all of your environment variables (including path) Commented Jun 20, 2017 at 22:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.