Created
November 22, 2021 07:49
-
-
Save NaClYen/4cfd16144e9cad38f852d0548e4ff1f6 to your computer and use it in GitHub Desktop.
powershell Wait-Job for multi jobs
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
function Wait-Test { | |
$a = Start-Job -ScriptBlock { ping 8.8.8.8 } | |
$b = Start-Job -ScriptBlock { echo "test" } | |
Wait-Job $a,$b | |
echo "done" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment