Convert a month number to month name using PowerShell Convert a month number to month name using PowerShell powershell powershell

Convert a month number to month name using PowerShell


Full month name:

(Get-Culture).DateTimeFormat.GetMonthName(8)

Abbreviated:

(Get-Culture).DateTimeFormat.GetAbbreviatedMonthName(8)


If you're looking for the current month, try this:

$currentMonth = Get-Date -UFormat %m$currentMonth = (Get-Culture).DateTimeFormat.GetMonthName($currentMonth)


(Get-Culture).DateTimeFormat.GetMonthName((Get-Date).Month)