Skip to content

Instantly share code, notes, and snippets.

@msmorul
Created April 20, 2016 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msmorul/ef106b9123f961d21532e49cf488114c to your computer and use it in GitHub Desktop.
Save msmorul/ef106b9123f961d21532e49cf488114c to your computer and use it in GitHub Desktop.
function getMonday {
$days="Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
return (Get-Date).AddDays(-([array]::IndexOf($days,(Get-Date).DayOfWeek.ToString())-1))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment