WeekOfMonth
Line Break
Author: Martin Zugec (31 Articles)
Today I needed small function to determine what is the number of current week (usually referred as WeekOfMonth).
Code is very simple in fact:
Function Get-WeekOfMonth ([datetime]$Date = $(Get-Date)) {
[int]$Day = $Date.Day
Return [math]::Ceiling($Day / 7)
}
Martin