fix(wakeup): fix trailing countdown error

This commit is contained in:
Asif Bacchus 2021-09-06 16:04:36 -06:00
parent 56a910d714
commit 140edc1cb1
1 changed files with 2 additions and 2 deletions

View File

@ -205,14 +205,14 @@ do
} }
# sleep until next test interval and increase time counter # sleep until next test interval and increase time counter
if ($targetComputers.Count -gt 0) $connCheckTotalTime += $ConnectivityCheckInterval
if ($connCheckTotalTime -le $ConnectivityCheckTimeout -and $targetComputers.Count -gt 0)
{ {
for ($i = $ConnectivityCheckInterval; $i -gt 0; $i--) { for ($i = $ConnectivityCheckInterval; $i -gt 0; $i--) {
Write-Progress -Activity "Waiting for next connectivity check..." -SecondsRemaining $i Write-Progress -Activity "Waiting for next connectivity check..." -SecondsRemaining $i
Start-Sleep 1 Start-Sleep 1
} }
Write-Progress -Activity "Waiting for next connectivity check..." -Completed Write-Progress -Activity "Waiting for next connectivity check..." -Completed
$connCheckTotalTime += $ConnectivityCheckInterval
} }
} while ($connCheckTotalTime -le $ConnectivityCheckTimeout -and $targetComputers.Count -gt 0) } while ($connCheckTotalTime -le $ConnectivityCheckTimeout -and $targetComputers.Count -gt 0)