PowerTip: Use PowerShell to Show How Many Days Until the End of the Year

Doctor Scripto

Summary: Learn how to use the New-TimeSpan cmdlet to see the number of days until the end of the year.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see the number of days until the end of the year?

                       Hey, Scripting Guy! Answer Use the New-TimeSpan cmdlet. Use Get-Date for the start and the day you wish for the endThe following shows this technique by using a U.S. English cultural setting.

                                             New-TimeSpan -Start (get-date) -End 12/31/2012

 

0 comments

Discussion is closed.

Feedback usabilla icon