We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d569ee7 + c0aa8a2 commit f89d147Copy full SHA for f89d147
src/Log-Rotate/classes/New-LogObject.ps1
@@ -719,6 +719,10 @@ function New-LogObject {
719
if ($_now_dt.Month -gt $_last_dt.Month) {
720
Write-Verbose "Time interval over. This is the first time logrotate is run this month. "
721
return $true
722
+ }elseif ($_now_dt.Year -gt $_last_dt.Year) {
723
+ # The case where the current year is a new year
724
+ Write-Verbose "Time interval over. Last rotation occured last year. Last rotation: $($_last_dt.ToString('s'))"
725
+ return $true
726
}else {
727
Write-Verbose "Time interval not over. Last rotation already occured this month. Last rotation: $($_last_dt.ToString('s'))"
728
}
0 commit comments