Created
June 22, 2014 15:37
-
-
Save martin9700/ce920a98e1bf0dca6038 to your computer and use it in GitHub Desktop.
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
$Count = 0 | |
Do { | |
$TotProg = 0 | |
ForEach ($Job in $Jobs) | |
{ Try { | |
$Prog = ($Job | Get-Job).ChildJobs[0].Progress.StatusDescription[-1] | |
If ($Prog -is [char]) | |
{ $Prog = 0 | |
} | |
$TotProg += $Prog | |
} | |
Catch { | |
Start-Sleep -Milliseconds 500 | |
Break | |
} | |
} | |
Write-Progress -Id 1 -Activity "Watching Background Jobs" -Status "Waiting for background jobs to complete: $TotProg of $Total" -PercentComplete (($TotProg / $Total) * 100) | |
Start-Sleep -Seconds 3 | |
} Until (($Jobs | Where State -eq "Running").Count -eq 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment