Last active
October 17, 2026 10:42
-
-
Save scriptingstudio/6993692e9246d64e0e81b77c237d45a7 to your computer and use it in GitHub Desktop.
PowerShell culture selector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-Culture ([string]$name, [int]$lcid, [switch]$list) { | |
| if ($list) { | |
| return [cultureinfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) | |
| } | |
| if (-not $name -and $lcid -lt 1) {return Get-Culture} | |
| if (-not $name) {$name = 'zzzzzzzzz'} | |
| [cultureinfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) | | |
| Where-Object {$_.name -eq $name -or $lcid -eq $_.lcid} | |
| } # END New-Culture |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment