Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting definitions for Microsoft.Win32.RegistryKey access the local registry even with remote output #10341

mklement0 opened this issue Aug 10, 2019 · 0 comments


Copy link

commented Aug 10, 2019

The formatting instructions for type Microsoft.Win32.RegistryKey are also applied when registry-key information is returned via remoting; i.e, the deserialized Deserialized.Microsoft.Win32.RegistryKey custom-object copies are formatted the same way as live Microsoft.Win32.RegistryKey instances.

The calculated Property column calls Get-ItemProperty in order to also show information about the registry key's values, but blindly assumes that the local registry should be queried, resulting in a spurious mix of remote and local information on output.

For more information, see this StackOverflow post.

Steps to reproduce

# Temporarily create a string value named `zzz` with value `hi` in your local registry
Set-ItemProperty HKCU:\Console zzz hi

# Retrieve HKCU:\Console from a *different* computer.
Invoke-Command -ComputerName someOtherComputer { Get-Item HKCU:\Console  }

# Clean up
Remove-ItemProperty HKCU:\Console zzz

Expected behavior

The output should show only information about the remote registry key.

Actual behavior

The output's Property column shows information about the local registry key, as evidenced by value zzz showing in the output.

Environment data

PowerShell Core 7.0.0-preview.2
Windows PowerShell 5.1.18362.125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.