Hello folks,
A powershell beginner here, editing a script and puzzled by this section where my Timeofday calculation resets at 60, instead of 0 and then stopping.
$waittime=120#seconds
$Time=(get-date).TimeofDay
do{
sleep1
$timeleft=$waittime-($Newtime.seconds)
Write-host"Waiting until $timeleftseconds"
$Newtime=(Get-Date).TimeofDay -$Time
} until(($Newtime).Seconds -ge$waittime)
The output displays starting with 120 correctly, but resets at 60 for some reason instead of stopping at 0.
Anyone have a suggestion on how to correct or a hint? :)
- Edited by romatlo Tuesday, January 27, 2015 11:00 PM


