Skip to content

Commit 3815a44

Browse files
committed
twenty minutes
1 parent b96eafd commit 3815a44

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Modules/Scripts/Remove-BrowserHijack.ps1

+6-4
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,16 @@ Process
131131

132132
while ($Repeat)
133133
{
134-
# hijacks are established every hour on the hour
134+
# hijacks are established every hour on the hour?
135135
# so calc diff to next hour plus a minute for wiggle room
136136

137-
$sleep = (New-TimeSpan -End (get-date -Minute 0 -Second 0).AddHours(1)).TotalSeconds + 60
138-
$minutes = [Math]::Round($sleep / 60)
137+
$span = New-TimeSpan -End (get-date -Minute 0 -Second 0).AddHours(1)
138+
# check every 20 mins on the 20 minute mark
139+
$seconds = ($span.Minutes -gt 20) ? (($span.Minutes % 20 + 1) * 60) + 60 : $span.TotalSeconds + 60
140+
$minutes = [Math]::Round($seconds / 60)
139141

140142
Write-Host "... $((get-date).toString('yyyy-MM-dd hh:mm')) sleeping $minutes minutes"
141-
Start-Sleep -Seconds $sleep
143+
Start-Sleep -Seconds $seconds
142144
FixEmAll
143145
}
144146
}

0 commit comments

Comments
 (0)