You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce an -Any switch that makes Wait-Process return as soon as any one of the target processes terminates.
Complement it with a -PassThru switch to pass a process-info object(s) for the terminated process(es) through - this should work whether or not -Any is used.
Summary of the new feature / enhancement
Passing multiple processes to
Wait-Processcurrently makes the latter wait for all target processes.However, it is sometimes desirable to only wait for any one of these processes to terminate.
Proposed technical implementation details (optional)
Introduce an
-Anyswitch that makesWait-Processreturn as soon as any one of the target processes terminates.Complement it with a
-PassThruswitch to pass a process-info object(s) for the terminated process(es) through - this should work whether or not-Anyis used.