| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
As a user I want to specify the UI culture when running Get-Help, so that I can read help content in the language I choose, independently of my operating system's display language.
PowerShell's updatable help is asymmetric today:
So help content a user installed in a second language is unreachable without changing the machine or session culture. Concrete pain points:
Scope note: comment-based help is single-language by design. -UICulture affects file-based help content: MAML XML help shipped by modules or installed via Update-Help, culture-specific about_* topics, and provider help. For a module that only ships comment-based help, the parameter has no visible effect. When the parameter is omitted, behavior is exactly as today.
# OS UI culture is de-DE; English help additionally installed with:
Update-Help -UICulture en-US
Get-Help Get-ChildItem # de-DE help (default, unchanged)
Get-Help Get-ChildItem -UICulture en-US # en-US help, without touching the session culture
Get-Help about_Logging -UICulture en-US # about topics resolve the same way
Get-Help Get-ChildItem -UICulture nl-NL # nl-NL not installed -> falls back nl -> en-US -> en,
# the same fallback chain used todayGet-Help cmdlet (help/HelpCommands.cs, class GetHelpCommand)
|
v
HelpRequest (help/HelpRequest.cs - carries target, category, filters...
| but NO culture field)
v
HelpSystem / providers (help/HelpSystem.cs, *HelpProvider.cs)
|
v
MUIFileSearcher (help/MUIFileSearcher.cs - HERE the culture is chosen:
| reads CultureInfo.CurrentUICulture and searches
v <culture>\, parent cultures, '', en-US\, en\)
The language decision happens implicitly, deep inside the engine. There is no way for the caller to influence it.
Added to GetHelpCommand, valid in all parameter sets:
/// <summary>
/// Gets or sets the UI culture of the help content to return.
/// When not specified, the current UI culture is used (existing behavior).
/// </summary>
[Parameter]
[ValidateNotNull]
[Alias("Language")]
public CultureInfo UICulture { get; set; }One rule summarizes the design: if the request carries a culture, it wins for this one lookup; otherwise nothing changes.
test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Help.Tests.ps1, with a fixture module shipping a second culture's about_* topic (and ideally a small MAML help file):
(A search for an existing feature request for this turned up nothing - closest are the issues above.)
| Back | FazBrowse Home | New Git URL |
Activity