Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Do/while jobs still running.

$
0
0

Plan is to query the jobs for 10 minutes or until they have all completed, but it still always goes on for the 10 minutes. I want to output the results also during the do/while time. What am I missing?

$time = 0 do{ sleep -Seconds 5 $Result = get-job -name "*-Validate" | where state -eq Completed | Receive-job $Result.Online $time++ } while((Get-job -name "*-Validate" | where state -eq Running) -and ($Time -lt 120)) 

submitted by /u/Mskews
[link] [comments]

The post Do/while jobs still running. appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles