Files
PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1
T
Christoph Bergmeister fa544c33db Update links that contain 'en-us' culture (#7013)
Update links that contain 'en-us' culture to remove 'en-us' culture (if possible) and in some cases update to newer re-directed link to docs.microsoft.com
2018-06-08 10:49:03 +05:00

28 lines
803 B
PowerShell

# Sample code from https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_internationalization?view=powershell-6&viewFallbackFrom=powershell-Microsoft.PowerShell.Core
$Day = DATA {
# culture="en-US"
ConvertFrom-StringData @'
messageDate = Today is
d0 = Sunday
d1 = Monday
d2 = Tuesday
d3 = Wednesday
d4 = Thursday
d5 = Friday
d6 = Saturday
'@
}
Import-LocalizedData -BindingVariable Day
# Build an array of weekdays.
$a = $Day.d0, $Day.d1, $Day.d2, $Day.d3, $Day.d4, $Day.d5, $Day.d6
# Get the day of the week as a number (Monday = 1).
# Index into $a to get the name of the day.
# Use string formatting to build a sentence.
"{0} {1}" -f $Day.messageDate, $a[(get-date -uformat %u)] | Out-Host