Using Cultures

by Dec 23, 2008

Since PowerShell is culture-independent, you can pick any culture you want and use the culture-specific formats. The following script instantiates the Japanese culture, outputting a number as currency first in your current culture and then in the Japanese culture.

$culture = New-Object System.Globalization.CultureInfo("ja-JP")
$number = 100
$number.toString('c', $culture)

Learn more about what cultures are available and their identifiers by visiting MSDN:

This works for many data formats such as toString(), which expects the data format you want to convert the data to:

Here is an example with dates:

(Get-Date).toString("d", $culture)