Last active
August 29, 2015 14:06
-
-
Save jtuttas/335b2c10f2451ab02e50 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Write-Host "Zählen startet" | |
$z1 = Start-Job { | |
for ($i=0;$i -lt 3;$i++) { | |
"Zaehler 1 ist bei $i" | |
sleep 1 | |
} | |
} | |
$z2 = Start-Job { | |
for ($i=0;$i -lt 6;$i++) { | |
"Zaehler 2 ist bei $i" | |
sleep 1 | |
} | |
} | |
while ($z2.State -eq "Running" -or $z1.State -eq "Running") { | |
if ($z1.HasMoreData -and $z1.State -eq "Running") { Receive-Job -Job $z1} | |
if ($z2.HasMoreData -and $z2.State -eq "Running") { Receive-Job -Job $z2} | |
} | |
Write-Host "Zählen beendet" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment