Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Forwarding progress stream changes from Foreach-Object -Parallel runspaces#14271

Merged
iSazonov merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
powercode:parallel_progresspowercode/PowerShell:parallel_progressCopy head branch name to clipboard
Jul 31, 2021
Merged

Forwarding progress stream changes from Foreach-Object -Parallel runspaces#14271
iSazonov merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
powercode:parallel_progresspowercode/PowerShell:parallel_progressCopy head branch name to clipboard

Conversation

@powercode

@powercode powercode commented Nov 26, 2020

Copy link
Copy Markdown
Collaborator

PR Summary

Forwarding progress stream changes from Foreach-Object -Parallel runspaces in the same way as the other streams.
#14254

PR Context

Now looks like this.
That it doesn't render perfectly is a separate issue.

function Show-Progress {
    param([int] $ThrottleLimit = 4)
    $parentId = 100
    Write-Progress -Id $parentId -Activity Parent -status Parallel
    1..20 | Foreach-Object -ThrottleLimit $ThrottleLimit -Parallel {
        $progress = @{
            Id               = $_
            Activity         = "Activity $_"
            CurrentOperation = "Operation $_"
            PercentComplete  = 0
            ParentId         = $using:parentId
        }
        
        Write-Progress @progress
        Start-sleep -Seconds 1
        $id
        foreach ($p in 1..100) {
            $progress.PercentComplete = $p
            Write-Progress @progress
            Start-Sleep -Milliseconds 100
        }
        start-sleep -Seconds 1
        Write-Progress @progress -Completed
    }         
    Write-Progress -Id 1 -Acti Parent -completed
}

image

image

The test looks different as the Progress stream is not forwardable. So the API is used instead.

PR Checklist

@ghost ghost assigned iSazonov Nov 26, 2020
@iSazonov iSazonov requested a review from PaulHigin November 26, 2020 16:16
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 26, 2020
@iSazonov

Copy link
Copy Markdown
Collaborator

@powercode Please add some example scripts/screenshot.
And we need test(s).

@ghost ghost added the Review - Needed The PR is being reviewed label Dec 4, 2020
@ghost

ghost commented Dec 4, 2020

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@tlsalex

tlsalex commented Jan 25, 2021

Copy link
Copy Markdown

A few days had passed , the fix still on its way ?

@PaulHigin PaulHigin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @powercode Thanks for adding this!

…bject-Parallel.Tests.ps1

Co-authored-by: Ilya <darpa@yandex.ru>
@tlsalex

tlsalex commented Jul 28, 2021

Copy link
Copy Markdown

34 successful and 1 expected checks

what action need to take for the 1 "expected checks" ?

@tlsalex

tlsalex commented Jul 31, 2021

Copy link
Copy Markdown

@powercode could you help to compile latest Powershell code but with your fix for windows x64 ? I want to use this feature before official release . I am not a code man , I don't know how to compile it. thanks !

@iSazonov iSazonov closed this Jul 31, 2021
@ghost ghost removed the Review - Needed The PR is being reviewed label Jul 31, 2021
@iSazonov iSazonov reopened this Jul 31, 2021
@iSazonov

Copy link
Copy Markdown
Collaborator

@tlsalex You can download build.zip from CIs.

@iSazonov

Copy link
Copy Markdown
Collaborator

/rebase

@iSazonov iSazonov changed the title Fixes #14254: foreach -Parallel does not display progress Forwarding progress stream changes from Foreach-Object -Parallel runspaces Jul 31, 2021
@iSazonov iSazonov merged commit 1bfa1c3 into PowerShell:master Jul 31, 2021
@iSazonov iSazonov added this to the 7.2.0-preview.9 milestone Jul 31, 2021
@powercode powercode deleted the parallel_progress branch August 16, 2021 14:07
@ghost

ghost commented Aug 23, 2021

Copy link
Copy Markdown

🎉v7.2.0-preview.9 has been released which incorporates this pull request.:tada:

Handy links:

@ghost

ghost commented Sep 28, 2021

Copy link
Copy Markdown

🎉v7.2.0-preview.10 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.