Summary: Use Windows PowerShell to find the number of hours in a number of days.
How can I use Windows PowerShell to easily figure out how many hours are in 30 days without
doing any multiplication?
Use New-TimeSpan to create a timespan object for 30 days. The output will tell the number of hours,
minutes, and seconds in the timespan. Here is an example:
New-TimeSpan -Days 30
To return only the number of hours, retrieve the TotalHours property:
PS C:\> (New-TimeSpan -Days 30).totalhours