Using Powershell how do you get the weekday number?

后端 未结 3 2145
无人及你
无人及你 2020-12-16 15:48

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

3条回答
  •  忘掉有多难
    2020-12-16 16:35

    like this:

    ( get-date ).DayOfWeek.value__
    

    I suggest for the future to investigate what properties an object in this way:

    ( get-date ).DayOfWeek | gm -f # gm is an alias for get-member
    

提交回复
热议问题