To hide a progress bar explicitly, you call Write-Progress -Completed
Doing so currently requires that an -Activity argument be passed as well, even though that shouldn't be necessary, given that such an argument is only relevant for displaying the progress bar, not when hiding it.
Therefore, Write-Progress -Completed by itself should be sufficient to hide a progress bar (potentially combined with -Id to disambiguate, should multiple ones have been created).
Steps to reproduce
foreach ($i in 1..10) { Write-Progress $i -Activity foo; start-sleep -ms 100 }
Write-Progress -Completed
'Done'
Expected behavior
The progress bar should display, then disappear, followed by output 'Done'.
Actual behavior
Write-Progress -Completed unexpectedly prompts for an -Activity parameter value.
Environment data
PowerShell Core 7.2.0-preview.5
To hide a progress bar explicitly, you call
Write-Progress -CompletedDoing so currently requires that an
-Activityargument be passed as well, even though that shouldn't be necessary, given that such an argument is only relevant for displaying the progress bar, not when hiding it.Therefore,
Write-Progress -Completedby itself should be sufficient to hide a progress bar (potentially combined with-Idto disambiguate, should multiple ones have been created).Steps to reproduce
Expected behavior
The progress bar should display, then disappear, followed by output
'Done'.Actual behavior
Write-Progress -Completedunexpectedly prompts for an-Activityparameter value.Environment data