MonthName


Definition: Returns a string indicating the specified month

 

Sometimes all you want to know is that we’re in month number 9; at other times you’d prefer to know the nameof the month (e.g., September). In Windows PowerShell you can determine the name of the month by using the Get-DateCmdlet and then using the –fformatting parameter and the value MMMM. In other words, this command will retrieve the name of the month for the current month and store that value in the variable $a:

 

$a = get-date -f "MMMM"

 

When you run this command and then echo back the value of $ a youshould get the following (depending on the actual month):

 

September