Skip to content

Foreach-Object -Parallel examples of how to report progress #6160

@scott1138

Description

@scott1138

It would be great if we could get more examples of some complex scenarios using the -Parallel parameter. Recently I wanted to use Write-Progress, but as I had assumed, it doesn't work across runspaces. I resorted to using the concurrent bag collection to add objects at the start of the runspace and then get the count of items and then over-write the same line with "x of n completed" sort of thing. If there is a better way to do this I would love to see some examples.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

area-parallelismArea - Parallel processing (ForEach-Object, Jobs, etc)issue-doc-ideaIssue - request for new contentup-for-grabsTag - issue is open for any contributor to resolve

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions