Hi All.
Get-RegKeys { # Variant 1: $LMRegKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("SOFTWAREMicrosoft.NETFrameworkv3.0") # Variant 2: # $LMRegKey = Get-Item -Path "HKLM:SOFTWAREMicrosoft.NETFrameworkv3.0" if ($LMRegKey -eq $NULL) { return } $LMRegKey | Get-Member # Both variants return object of Microsoft.Win32.RegistryKey class # But next code line return different results (the first variant works incorrectly) !!! $LMRegKey | Get-ChildItem | Get-ChildItem }function
Why it happens?
Regards
P.S. Sorry for my English.