Get-Culture

Get information about regional settings e.g. current language and keyboard layout.

Syntax
      Get-Culture [CommonParameters]

Properties available:

AbbreviatedDayNames
AbbreviatedMonthGenitiveNames
AbbreviatedMonthNames
AlgorithmType
AMDesignator
Calendar
Calendar
CalendarType
CalendarWeekRule
CompareInfo
CultureTypes
DateSeparator
DateTimeFormat
DayNames
DisplayName
EnglishName
Eras
FirstDayOfWeek
FullDateTimePattern
IetfLanguageTag
IsNeutralCulture
IsReadOnly
IsReadOnly
IsReadOnly
KeyboardLayoutId
LCID
LongDatePattern
LongTimePattern
MaxSupportedDateTime
MinSupportedDateTime
MonthDayPattern
MonthGenitiveNames
MonthNames
Name
NativeCalendarName
NativeName
NumberFormat
OptionalCalendars
PMDesignator
RFC1123Pattern
ShortDatePattern
ShortestDayNames
ShortTimePattern
SortableDateTimePattern
TextInfo
ThreeLetterISOLanguageName
ThreeLetterWindowsLanguageName
TimeSeparator
TwoDigitYearMax
TwoLetterISOLanguageName
UniversalSortableDateTimePattern
UseUserOverride
YearMonthPattern

Return type:
System.Globalization.CultureInfo object

Examples

This demonstrates drilling down and displaying the properties and sub-properties of the object.

PS C:\> $c = get-culture
PS C:\> $c | Format-List -property *
PS C:\> $c.calendar
PS C:\> $c.datetimeformat
PS C:\> $c.datetimeformat.firstdayofweek

Title-case a string so that each word starts with an uppercase letter:

PS C:\> $string = "this is a word or sentence"
PS C:\> $textInfo = (Get-Culture).TextInfo

PS C:\> $textInfo.ToTitleCase($string)
This Is A Word Or Sentence

“The eternally incomprehensible thing about the world is that it is comprehensible” ~ Albert Einstein

Related PowerShell Cmdlets

Get-UICulture - Get ui culture information.
ToLower() and ToUpper() methods.


 
Copyright © 1999-2024 SS64.com
Some rights reserved