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\>
Get-ItemProperty.Pathis a property ofEnvironment. It would just seem logical that the provider would presentPathas a child item ofEnvironment.(Get-ItemProperty .).PathGCI Env:for all of your environment variables (including path)