Most years have 52 weeks, some have 53, according to ISO8601.



Task

Write a function which determines if a given year is long (53 weeks) or not, and demonstrate it.




Function Is-Long-Year {
  param([Int]$year)
  53 -eq (Get-Date -Year $year -Month 12 -Day 28 -UFormat %V)
}
 
For ($y=1995; $y -le 2045; $y++) {
  If (Is-Long-Year $y) {
    Write-Host $y
  }
}