Using a Powershell date object how do you get the day number of the week, 0 to 6 where 0 would be Sunday and 6 would be Saturday. I know that I can get the day name with the
Well, the DayOfWeek property of a DateTime is not a string but rather a DayOfWeek enum, so the shortest answer is probably
DayOfWeek
DateTime
[Int] (Get-Date).DayOfWeek # returns 0 through 6 for current day of week
Or
[Int] [DayOfWeek] "Wednesday" # returns 3