3

Use PowerShell to Figure Out "What day of the week is it 39 (or some other...

 3 years ago
source link: https://thomasrayner.ca/use-powershell-to-figure-out-what-day-of-the-week-is-it-39-or-some-other-number-days-from-now/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Use PowerShell to Figure Out "What day of the week is it 39 (or some other number) days from now?"

There’s lots of fun things you can do with datetime objects in PowerShell, and using the Get-Date cmdlet. Here’s one of them.

Say you want to know what day of the week it will be some arbitrary number of days from now. It’s pretty easy.

PS> (Get-Date).AddDays(39).DayOfWeek
Friday

At the time I write this, it looks like in 39 days, it’ll be Friday.

Written on July 5, 2017

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK