Monday, November 17, 2008

get day of week from the past date (Powershell)

This script allows you to quickly get a day of week from a provided date in the past. Quickly get the DOB date to test it :).

(get-date "1/1/2008").DayOfWeek

p.s. works just as well for future dates:

PS C:\Powershell> (get-date "01/20/2009").DayOfWeek

Quick, what is the significance of this date?

Taken from "Manning Windows Powershell in Action"
Post a Comment