MegaBites-AI/Windows-powershell
0372
1# Sample code from https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_internationalization2 3 $Day = DATA {4# culture="en-US"5ConvertFrom-StringData @'6 messageDate = Today is7 d0 = Sunday8 d1 = Monday9 d2 = Tuesday10 d3 = Wednesday11 d4 = Thursday12 d5 = Friday13 d6 = Saturday14'@15}16 17Import-LocalizedData -BindingVariable Day18 19# Build an array of weekdays.20$a = $Day.d0, $Day.d1, $Day.d2, $Day.d3, $Day.d4, $Day.d5, $Day.d621 22 # Get the day of the week as a number (Monday = 1).23 # Index into $a to get the name of the day.24 # Use string formatting to build a sentence.25 26 "{0} {1}" -f $Day.messageDate, $a[(Get-Date -UFormat %u)] | Out-Host27 28 