You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write-Progress at the beginning of outer loop and inner loop, using reference to parent ID for inner loop
Perform some lengthy operation in inner loop, then update inner progress
After inner loop completes, update outer progress
[int] $innerPercent=0
[int] $outerPercent=0for ($i=0; $i-lt2; $i++) {
Write-Progress-Activity "Testing"-Status "Progress:"-Id 1-PercentComplete $outerPercent-CurrentOperation "Outer : $i"for ($j=0; $j-lt5; $j++) {
# This has no effectWrite-Progress-Activity "Testing"-Status "Progress:"-Id 2-PercentComplete $innerPercent-CurrentOperation "Inner : $j"# Performing some long operation here.Start-Sleep5$innerPercent= ($j+1) /5*100Write-Progress-Activity "Testing"-Status "Progress:"-Id 2-PercentComplete $innerPercent-CurrentOperation "Inner : $j"
}
# Sleeping to allow final Write-Progress of inner loop to renderStart-Sleep5# Hide inner progressWrite-Progress-Activity "Testing"-Id 2-Completed
$outerPercent= ($i+1) /2*100# This has no effectWrite-Progress-Activity "Testing"-Status "Progress:"-Id 1-PercentComplete $outerPercent-CurrentOperation "Outer : $i"
}
# Sleeping to allow final Write-Progress of outer loop to renderStart-Sleep5# Hide outer progressWrite-Progress-Activity "Testing"-Id 1-Completed
Expected behavior
All Write-Progress calls to update the progress on the console.
Actual behavior
- The Write-Progress call before the operation in the inner loop does not render.
- The final Write-Progress call after the outer loop terminates does not render.
Note: This worked correctly in 5.1 and may be related to issue #3366
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.0.0-beta.9
PSEdition Core
GitCommitId v6.0.0-beta.9
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
Expected behavior
Actual behavior
Environment data