-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
Description
Steps to reproduce
- Create and inner and outer loop
- 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 = 0
for ($i = 0; $i -lt 2; $i++) {
Write-Progress -Activity "Testing" -Status "Progress:" -Id 1 -PercentComplete $outerPercent -CurrentOperation "Outer : $i"
for ($j = 0; $j -lt 5; $j++) {
# This has no effect
Write-Progress -Activity "Testing" -Status "Progress:" -Id 2 -PercentComplete $innerPercent -CurrentOperation "Inner : $j"
# Performing some long operation here.
Start-Sleep 5
$innerPercent = ($j + 1) / 5 * 100
Write-Progress -Activity "Testing" -Status "Progress:" -Id 2 -PercentComplete $innerPercent -CurrentOperation "Inner : $j"
}
# Sleeping to allow final Write-Progress of inner loop to render
Start-Sleep 5
# Hide inner progress
Write-Progress -Activity "Testing" -Id 2 -Completed
$outerPercent = ($i + 1) / 2 * 100
# This has no effect
Write-Progress -Activity "Testing" -Status "Progress:" -Id 1 -PercentComplete $outerPercent -CurrentOperation "Outer : $i"
}
# Sleeping to allow final Write-Progress of outer loop to render
Start-Sleep 5
# Hide outer progress
Write-Progress -Activity "Testing" -Id 1 -CompletedExpected 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.0Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues