Skip to content

Instantly share code, notes, and snippets.

@jonfazzaro
Created June 28, 2018 12:32
Show Gist options
  • Save jonfazzaro/02d17d14b1754b58412b3995c32550ca to your computer and use it in GitHub Desktop.
Save jonfazzaro/02d17d14b1754b58412b3995c32550ca to your computer and use it in GitHub Desktop.
A script for running multiple processes in parallel.
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