Skip to content

Instantly share code, notes, and snippets.

@martin9700
Last active November 15, 2016 14:14
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 martin9700/0a584c2da948918647bd6e34cdb6eff7 to your computer and use it in GitHub Desktop.
Save martin9700/0a584c2da948918647bd6e34cdb6eff7 to your computer and use it in GitHub Desktop.
#Define Quarters
$Quarters = @{}
$Start = Get-Date -Month 1 -Date 1 -Year (Get-Date).Year
ForEach ($Q in (1..4))
{
$Quarters.Add($Q,[PSCustomObject]@{
From = $Start
To = $Start.AddMonths(3).AddTicks(-1)
})
$Start = $Start.AddMonths(3)
}
#Define this quarter
$Quarter = [int]([math]::Ceiling((Get-Date -Format MM)/3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment