Get-Date Multi Language PowerShell
Hello,
Today I wanted to share a nice trick that will allow you to write the full date in another language than the one from your current Windows configuration. This method will work with any DateTime object and all of the cultures supported by your .Net version.
Get-Date in a different language with PowerShell
By default, Get-Date will return the dates based on your system language:

If you want to write this date in Spanish, it’s a bit more complicated, you need to use the .Net class named CultureInfo. This will contains other languages months and days names:

$ES = New-Object System.Globalization.CultureInfo("es-ES")
$ES.DateTimeFormat.DayNames
$ES.DateTimeFormat.MonthNames
Then, with this in mind, we can build something a bit more complex like this:

"{0} {1} {2}" -f $es.DateTimeFormat.DayNames[$Date.DayOfWeek.value__],$es.DateTimeFormat.MonthNames[$Date.Month-1],$Date.Year
This line uses the “-f” format operator to allow us to search through the $ES variable for the localized names of month & day based on the current date.
You do this with other languages such as:
- EN-US
- RU-RU
- DE-DE
- Etc…
The full list of possible languages is available with:
[System.Globalization.CultureInfo]::GetCultures("AllCultures")
Conclusion
You can now build some date in every format supported by .Net, very convenient if you need to send customized emails with long date format in different languages.
Edit: A reader pointed to me that there is kind of an easier way to do it:
([DateTime]"01/01/2020").ToString('D',[CultureInfo]::CreateSpecificCulture("es-es"))
This is achieved thanks to an overload of the ToString method:

Thank you JB for your feedback 🙂
You made my day !