by Viper
29. January 2009 10:24
I was working on some automation script and somebody asked me whats the day of the week on a certain date. I was like lets see if i can do it without opening up calendar. So i decided to play around with get-date command in Powershell. And there it was, some fun with the command to try different things. Following are some commands that you can try yourself.
How to get day of week
get-date -format dddd
How to get day of week for any date
get-date -format dddd -Year 2010 -Month 2 -Day 28
Notice use of Year, Month and Date parameters. If you omit one of these parameters, then command will use today's component of that parameter.