Skip to content

Commit

Permalink
Actually waiting for all processes to exit
Browse files Browse the repository at this point in the history
  • Loading branch information
nahkd123 committed Apr 18, 2024
1 parent 6750605 commit c1a6012
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inking-otd/windows-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ if ($args.Count -Gt 1) {
if ($PSEdition -Eq "Core") { $pwshExe = "$PSHOME\pwsh.exe" }
else { $pwshExe = "$PSHOME\powershell.exe" }
Write-Output "Building in parallel..."
$processes = @()

foreach ($target in $args) {
Start-Process -NoNewWindow $pwshExe -ArgumentList "$($MyInvocation.InvocationName) $target" | Wait-Process
$processes += Start-Process -NoNewWindow $pwshExe -ArgumentList "$($MyInvocation.InvocationName) $target" -PassThru
}

$processes | Wait-Process
Write-Output "Done building in parallel!"
}

0 comments on commit c1a6012

Please sign in to comment.