Skip to content

Extend Get-Culture with a -Name parameter to allow retrieving a specific culture #3832

@mklement0

Description

@mklement0

Get-Culture currently supports returning information about the current culture.

It would be helpful if it supported a -Name switch to allow retrieving information about a specified culture.

(This would be analogous to existing Get-Date behavior, which by default returns the current date and optionally supports operating on a specified date via -Date.)

Also, as @iSazonov suggests, listing available cultures should be supported: -ListAvailable, supplemented by an optional -Type parameter that defaults to SpecificCultures - (see https://msdn.microsoft.com/en-us/library/system.globalization.culturetypes(v=vs.110).aspx for permissible values, though not all of them may make sense).

Desired behavior

# Should be the equivalent of: [cultureinfo]::GetCultureInfo('fr-FR')
> Get-Culture fr-FR      # assumes that -Name is the 1st positional param

LCID             Name             DisplayName                                                                                                                                      
----             ----             -----------                                                                                                                                      
1036             fr-FR            French (France)                                                                                                                                  

# Should be the equivalent of [cultureinfo]::GetCultures('SpecificCultures')
> Get-Culture -ListAvailable

LCID             Name             DisplayName                                                                                                                                      
----             ----             -----------                                                                                                                                      
4096             af-NA            Afrikaans (Namibië)                                                                                                                              
1078             af-ZA            Afrikaans (South Africa)                                                                                                                         
# ....

Environment data

PowerShell Core v6.0.0-beta (v6.0.0-beta.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions