-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Summary of the new feature / enhancement
Context:
Q:how to limit time for everypipe on ForEach-Object-Parallel?
Apparently, -timeoutsecond can't do that.
It can be understood like this:
If there is no "-ThrottleLimit" parameter, -TimeoutSeconds is basically as expected.
But now there is the "-ThrottleLimit" parameter, which makes -TimeoutSeconds unable to limit the runtime of each parallel.
**“-ThrottleLimit” and “-timeoutsecond” cause subsequent pipes to time out without starting execution **
So,we need -EverypipeTimeoutSecond.
time begin: from every parallel start
-timeoutsecond can't do that.
-timeoutsecond can limit total time for all pipes.
If there are many pipes and the execution time of each pipe is inconsistent, then limit total time does not look so good.
Both in the manual and in actual tests it is demonstrated that:
1..10 | ForEach-Object -ThrottleLimit 1 -TimeoutSeconds 2 -Parallel {
Start-Sleep -Seconds 1
$_
}
Proposed technical implementation details (optional)
No response