Created
June 28, 2018 12:32
-
-
Save jonfazzaro/02d17d14b1754b58412b3995c32550ca to your computer and use it in GitHub Desktop.
A script for running multiple processes in parallel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[String[]] $Files, | |
[String] $Run | |
) | |
$processes = @() | |
foreach ($f in $Files) { | |
$processes += Start-Process -FilePath $Run -ArgumentList $f -PassThru | |
} | |
foreach ($p in $processes) { | |
$p.WaitForExit(); | |
$p.ExitCode; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment