Skip to content

Commit

Permalink
fixed time comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
QBY-ChristianHartmann committed May 10, 2024
1 parent f745f6b commit 46ecaec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runbooks/Set-DeploymentSchedules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ foreach ($severityGroup in $severityGroups) {
$dayInterval = [int]$splitSeverityGroup[0]
$weekdayRepetition = $splitSeverityGroup[1]
$weekday = $splitSeverityGroup[2]
$plannedTime = (get-date ($splitSeverityGroup[3].Substring(0, 2) + ":" + $splitSeverityGroup[3].Substring(2, 2))).AddDays(1)
if ($plannedTime -lt (get-date)) {
$plannedTime = get-date ($splitSeverityGroup[3].Substring(0, 2) + ":" + $splitSeverityGroup[3].Substring(2, 2))
if ($plannedTime -lt (get-date).AddHours(2)) {
$startTime = $plannedTime.AddDays(1)
}
else {
$startTime = $plannedTime
}


Write-Output "StartTime of $severityGroup is $startTime"
$rebootSetting = $rebootOptions[$splitSeverityGroup[5]]
$queryTags = @{
"Severity Group Monthly" = "$($severityGroup)"
Expand Down

0 comments on commit 46ecaec

Please sign in to comment.