Powershell: Unable to get help files for cultures other than en-US

Created on 22 Feb 2018  路  17Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

Install Powershell Core (latest build) on a machine whose UI Culture is set to something other than en-US... In my case it's en-GB.

Run Update-Help from an administrator command prompt. Then try getting help on a basic command like help Update-Help -full. It will tell you that the help files aren't installed.

Expected behavior

Help files should be installed.

Actual behavior

Help files don't get installed.

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

I have worked around this by doing Update-Help -UICulture en-US, but I shouldn't have to do this. This command worked fine in Windows PowerShell.

One of the most amazing things about PowerShell is the rich help system. But if it doesn't work for a huge amount of users (anyone not in the US) then what's the point?

See this related issue: https://github.com/PowerShell/PowerShell/issues/5534

Issue-Bug WG-Interactive-HelpSystem

All 17 comments

@massimonewsuk Thanks for the feedback. If the help locale is not found, it should fallback to en-US automatically.

If the fallback isn't working, that should be fixed.

Just a reminder, this is still an issue with 6.0.4. Check the following output:

PS C:\Users\Test> update-help
update-help : Failed to update Help for the module(s) 'Microsoft.PowerShell.Core' with UI culture(s) {en-GB} : One or more errors occurred. (A task was canceled.)
At line:1 char:1
+ update-help
+ ~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [Update-Help], Exception
+ FullyQualifiedErrorId : UnknownErrorId,Microsoft.PowerShell.Commands.UpdateHelpCommand

Seeing this issue on 6.2.0 on Ubuntu 18.04 on a system set to en_GB. Worked around with the UICulture parameter mentioned above.

Got this issue on my desktop (Windows 7 SP1 with PS 6.2.1 Core, local Culture = fr-FR).
We should have a warning message saying that Update-help is not able to get help for the local Culture. It will help a lot of people to understand why they are not able to get the updated help (It took me 2 days to understand).

@SteveL-MSFT Can you please update a status on the issue? #6713 was closed with intention to port Windows PowerShell code - will we get this?

@iSazonov I looked into the WinPS code base, I don't see any special fallback logic. It simply uses the CultureInfo.Parent to find fallback which eventually fails. Due to geopolitical reasons, we can't just auto-fallback to en-US. I think the current fix is to update the error message telling the user they can specify another culture like en-US to get help text.

Eventually, we want to localize help, so this should not be as big an issue in the future (still need to work out how to do the localization...). Also, it seems that this worked in Windows PowerShell, because what happens is if you don't use the -UICulture parameter, it automatically uses [CultureInfo]::CurrentUICulture. On .NET Framework, the parent of en-GB is en, but the parent of en is en-US so it falls back to installing the en-US documentation. On .NET Core, the parent of en-GB is en and the parent of that is Invariant Language so it fails. We should continue to rely on .NET to do the right thing in regards to fallback, so we shouldn't special case en-US here. For now, I think the updated error message is sufficient.

Created https://github.com/dotnet/runtime/issues/955

We can explore if it's acceptable to default to en-US if there's nothing else and have a switch the user can use to explicit not fallback to en-US.

We could add new config/gpo parameter UseHelpFallbackCulture so that users can explicitly say that they want download help files in en-US or another culture.
It is very flexible. If I installed a module without ru-RU localization I could get en-US help files without extra steps.

Making it opt-in should be fine. To be clear, the current HelpSystem does automatic fallback, but it relies on the parent of the CultureInfo. In this case, en-US isn't going to be found by any culture other than en-US. So the switch should make this more clear. Perhaps -AllowFallbackToEnglish?

If we says about compliance policy I'd prefer to see the setting in GPO/config file. In the case an enterprise could set a policy they want. Also this is more flexible - an enterprise can fallback to any culture they set.
It is why I mentioned a module install scenario. The module could have German culture help, not English and I could prefer to fallback to the culture from ru-RU.
My proposal does not reject AllowFallbackToEnglish, but it could be -FallbackToCulture \.

@iSazonov Makes sense to allow custom fallback once we have localized help

@theJasonHelmick and @sdwheeler can you please reconcile this issue with the new updateable help pipeline? Specifically, have we solved the en-us fallback problem?

We only have help for en-US. I thought Update-Help would auto-fallback to en-US unless you specifically asked for a language using -UICulture parameter.

@joeyaiello The new pipeline does not change or improve the support for different languages.

The work-around does not work for me.

UPDATE-HELP Microsoft.PowerShell.Core -UICulture:en-US -DB

VERBOSE: Resolving URI: "https://go.microsoft.com/fwlink/?linkid=2113534"
VERBOSE: Your connection has been redirected to the following URI: "https://pshelp.blob.core.windows.net/powershell/help/7.0/Microsoft.PowerShell.Core/"
Performing the operation "Update-Help" on target "Microsoft.PowerShell.Core, Current Version: 7.0.0.0, Available
Version: 7.0.1.0, UICulture: en-US".
Update-Help: Failed to update Help for the module(s) 'Microsoft.PowerShell.Core' with UI culture(s) {en-US} : One or more errors occurred. (A task was canceled.).
English-US help content is available and can be installed using: Update-Help -UICulture en-US.

Well, show me!

@adityapatwardhan on the off chance you have a free moment to make Update-Help -UICulture en-US work as expected (given that we provide it as a workaround), it'd be awesome to sneak this into 7.1 (especially given that the behavior is uncontroversial).

I can have a look at this next week..

Was this page helpful?
0 / 5 - 0 ratings