Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Converting VBScript's GetLocale Function


Windows PowerShell


Definition: Returns the current locale ID value.

GetLocale

InVBScript you can identify the user's locale (which determines such things as keyboard layout and alphabetic sort order, as well as date, time, number, and currency formats) by calling the GetLocale function and then translating the returned ID number. You can get this same locale ID in Windows PowerShell by using the Get-Culture Cmdlet and looking at the value of the LCID property:



$a = (get-culture).lcid

When you run this command and then echo back the value of $a you should get the following, provided your computer has US English configured for its language and regional settings:



1033

If you’d prefer to see the locale name (as opposed to the ID number) use this command instead:



$a = (get-culture).displayname

That will return information similar to this:



English (United States)


Return to the VBScript to Windows PowerShell home page

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.