All the tuts I have found use a pre defined sleep time to throttle jobs. I need the throttle to wait until a job is completed before starting a new one. Only 4 jobs can be r
I noticed that every Start-Job command resulted in an additional conhost.exe
process in the task manager. Knowing this, I was able to throttle using the following logic, where 5
is my desired number of concurrent threads (so I use 4
in my -gt
statement since I am looking for a count greater than):
while((Get-Process conhost -ErrorAction SilentlyContinue).Count -gt 4){Start-Sleep -Seconds 1}