Skip to content

Write-Progress -Completed requires an -Activity argument, even though it is pointless #15252

@mklement0

Description

@mklement0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions