I want to execute multiple external scripts in PowerShell simultaneously and then wait for all of them to finish before proceeding. Currently I am using 'start-process -NoNewWindow ...' commandlet that loops through all child processes but then terminates.
I have found many ways to wait for 1 process to finish (this is obviously trivial) but none of them seem to work as a solution for my problem.
Having an equivalent for UNIX version in PowerShell would definitely be what I am looking for.
And don't forget about probably the most straight forward way to do this for mulitple processes - Wait-Process
e.g.:
$procs = $(Start-Process Notepad.exe -PassThru; Start-Process Calc.exe -PassThru)
$procs | Wait-Process
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With