Category filter
Script to get the current culture set on Windows devices
This document describes how to use a script to get the current culture set of Windows devices. Culture set on Windows showcases the preferences set for language, date, time, numbers, and other region-specific elements on the device. Fetching the current culture set is necessary for the organization to ensure that all Windows devices are configured according to their regional conventions. Administrators can use a script to fetch the current culture set on Windows devices. IT Administrators can execute the script to get the current culture set of the Windows devices using Hexnode’s Execute Custom Script remote action.
PowerShell script to get current culture settings on Windows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# Get the current culture information $cultureInfo = Get-Culture # Display culture information Write-Host "Name: $($cultureInfo.Name)" Write-Host "LCID: $($cultureInfo.LCID)" Write-Host "Language Name: $($cultureInfo.TwoLetterISOLanguageName)" Write-Host "Display Name: $($cultureInfo.DisplayName)" Write-Host "Calendar Type: $($cultureInfo.DateTimeFormat.Calendar)" Write-Host "Date Time Format: $($CultureInfo.DateTimeFormat)" Write-Host "Number Format: $($CultureInfo.NumberFormat)" Write-Host "Currency Symbol: $($cultureInfo.NumberFormat.CurrencySymbol)" Write-Host "Short Date Format: $($cultureInfo.DateTimeFormat.ShortDatePattern)" Write-Host "Long Date Format: $($cultureInfo.DateTimeFormat.LongDatePattern)" Write-Host "Short Time Format: $($cultureInfo.DateTimeFormat.ShortTimePattern)" Write-Host "Long Time Format: $($cultureInfo.DateTimeFormat.LongTimePattern)" Write-Host "First Day of Week: $($cultureInfo.DateTimeFormat.FirstDayOfWeek)" |
The “Get-Culture” command retrieves the current culture settings of the system, which include language, region, and other properties as detailed below.
Name- This represents the code for the culture, formatted as an abbreviation of the language name followed by the country code. For example, “en-US” denotes English in the United States.
LCID (Language Code Identifier)- This is a unique code used in Windows to represent a specific language and culture.
Language Name- This refers to a specific language variant set as the default display language for the user interface and system communications. For instance, “en” stands for English.
Display Name- This is the readable name associated with a specific language, presented to users in their native language.
Calendar Type- This indicates the calendar type used by a specific system, which can vary based on regional settings. For example, Gregorian Calendar, Chinese Lunar Calendar.
Date Time Format- This refers to the format in which dates and times are displayed in the user interface.
Number Format: This indicates how numbers are formatted in the system, including details like the decimal separator and grouping of digits.
Currency Symbol- This displays the currency type that is used by the system (e.g., “₹” for India, “$” for USA).
Short Date Format: This shows the abbreviated format used to display the dates.
Long Date Format: This shows the long date format.
Short Time Format: Displays the abbreviated format used to display time.
Long Time Format: Displays the long time format used to display time on the device.
First Day of Week: This indicates the day considered as the start of the week in the system’s regional settings.