Skip to content

Write-Progress bug when using ForEach-Object -Parallel and Read-Host -AsSecureString later #26843

Description

@Mister-HACB

Prerequisites

Steps to reproduce

When executing following Code

1..100 | ForEach-Object -Parallel {
    Write-Progress -Id 1 -Activity "Test" -PercentComplete $_ 
}
Write-Progress -Id 1 -Completed -Activity "Test" 
Read-Host -Prompt "Enter Any Text:" -AsSecureString

When typing text the Write-Progress Bar shows up and does not go away.
It does not happen when not using AsSecureString, but the bar pops up for a couple of milliseconds when closing the Terminal

Image

Maybe this bug is related to this one.
#25861

Expected behavior

Write-Progress bar not showing up

Actual behavior

Write-Progress bar does show up after typing first char

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             Microsoft Windows 10.0.26200
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions