Productivity Tools

Tools written by an IT business manager, a passionate developer.

Get day in a given week

The module calculates the date of the day of the week (Monday, Tuesday,.) for the given week. Let’s say that I would like to receive the first Monday after 2018.01.01 I could use the command

Get-DayInGivenWeek '2020.01.01' -Monday

and it will return

2020.01.06
Example

If I would like to find a previous one then I will use

Get-DayInGivenWeek '2020.01.01' -Monday -Before 2019.12.30

Day parameter can be omitted. Then the current date will be taken.

Simplest command
Close Bitnami banner
Bitnami