-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix Update-Help failing silently with implicit non-US culture. #17780
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
Fix Update-Help failing silently with implicit non-US culture. #17780
Conversation
|
@dkaszews Thanks for submitting the PR! |
|
@dkaszews I like the change. Thanks for the PR. For testing, I would add some test hooks to make sure we fall in to the expected code paths. Look at the files here to see how test hooks can be added: https://github.com/PowerShell/PowerShell/search?q=testhook&type=code Also, the test hook is used in product code like this: PowerShell/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs Lines 450 to 456 in 1779175
|
|
@adityapatwardhan Thanks for the tip! Please take a look if something like this is good. |
|
If found additional issues all related to matching culture:
Which of those should I fix here and which should be a separate issue? I would say the first one can be here, as it's just a single line, but the other I would prefer merging separately. |
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
CodeRefactor reports new issues in |
|
Thanks for the updates. If the CodeFactor issues are not in the code block you touched, you can ignore them. I would prefer both the changes 1 and 2 in a separate PR as it changes the behavior and is an improvement in fallback lookup. |
|
@adityapatwardhan Sure, I'll create new issues and separate PRs for those two later |
|
@adityapatwardhan Anything else I should do before this can be merged? |
|
@dkaszews thank you for your contribution! |
|
🎉 Handy links: |
PR Summary
HelpCultureNotSupportedis caught and ignored with implicit culture (-UICulturenot given explicitly, defaults to system) to allow trying again with culture's parents. It does not however check if there are any more fallbacks, so all errors of this type are completely silenced. I store first error of this type, then show it if none of the fallbacks succeed,Fixes #17696
PR Context
Update-Helpwith implcit culture fails silently on non-US systems (en-GBin my case), with no feedback on what is wrong even when using-Verbose. With this fix, the user is shown the same error as with explicit-UICulture (Get-UICulture), which clearly describes what they should do:PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).