-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Registry values of type REG_RESOURCE_REQUIREMENTS_LIST
are returned as NULL
#24626
Comments
(though I now see |
The registry type is described in drivers docs. It is too specific to have in pwsh. Nevertheless, here is a list types supported in .Net Runtime. There are more types than pwsh supports: REG_DWORD_LITTLE_ENDIAN, REG_DWORD_BIG_ENDIAN, REG_LINK. |
> The registry type is described in drivers docs.It is too specific to have in pwsh.
What does "too specific" mean? Having silent-ified values is a very poor experience. How would you know in advance if a property value is the "wrong" type or an actually null value?
(edited as the reply-via-email resulted in a rather badly formatted mess)
|
Thanks, @iSazonov - makes sense to align what registry value types PowerShell supports with what .NET supports. Separately, however, trying to use any unsupported type should result in an error rather than in quiet failure (and therefore no output). |
I agree it could be a non-termonating error, but we silently ignore unknown registry values for years so WG should weight the breaking change. |
The .NET docs seem to be incomplete on the types not supported, but they do indicate unsupported types return For PowerShell, it looks like we COULD use So the most I think can be done is return a warning, but I know users tend to hate those popping up when they didn't used to. So maybe this is a doc issue. |
The types are very specific - they are only for drivers. It's unbelievable that someone would write scripts to access such keys - it just doesn't make sense. So this change (non-terminating error) would be formal breaking change. |
You can't assume anything about what people might want to use Powershell for. If you do, then large documentation changes would be needed to somehow convey "appropriate use". Trivial example: comparison of "driver" registry key values between two machines is completely legitimate use of Powershell. |
Problem with making it only a docs issue is it weakens the use of Powershell. At runtime I still won't know the state of the registry, and I could NEVER know - no way to opt-in to even detect unsupported types It seems a really rather strong appeal to compatibility (with a reduction in the utility of an amazing tool) that new warnings could never be countenanced in any version. |
Prerequisites
Steps to reproduce
Using
Get-ItemPropertyValue
onpwsh 7.5.0 rc1
on Windows 10 22h2 to fetch a registry key that happens to contain some values of typeREG_RESOURCE_REQUIREMENTS_LIST
'successfully' returns the values of those property, but they are (silently) NULL.reg query
for the same key/value succeeds.Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
The text was updated successfully, but these errors were encountered: