Mauro Cazabonnet
asked on
While loop multiple conditions
Why wont the while loop break after the timeout in this example
$timeout = new-timespan -Seconds 10
$sw = [diagnostics.stopwatch]::StartNew()
$bool = $true
while (($sw.elapsed -lt $timeout) -or ($bool)){
start-sleep -seconds 2
}
write-host "Timed out"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It's perhaps worth noting that the second term in your condition is completely superfluous, but I assume it's part of something you're developing rather than the end result.
ASKER
Right thx!!!
ASKER
thx