Summary: Figure out how many days are in a month by using Windows PowerShell.
How can I use Windows PowerShell to find how many days are in a particular month?
Use the DaysInMonth static method from the System.DateTime object.
It expects the year and then the month as arguments. Here are a couple examples:
Days in October 2014:
[datetime]::DaysInMonth(14,10)
Days in February 2015:
[datetime]::DaysInMonth(2015,2)
0 comments