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

For ForEach-Object -Parallel, nested loops improvment #11817

Copy link
Copy link
@PrzemyslawKlys

Description

@PrzemyslawKlys
Issue body actions

While you're at improving ForEach-Object -Parallel please address this:

Doesn't work

$OhMy = 'Test'
(1..100) | ForEach-Object -Parallel {
    $Test = $Using:OhMy
    (1..50) | ForEach-Object -Parallel {
        $Test5 = $Using:Test
    }
}

image

Works:

$OhMy = 'Test'
$Test = $null
(1..100) | ForEach-Object -Parallel {
    $Test = $Using:OhMy
    (1..50) | ForEach-Object -Parallel {
        $Test5 = $Using:Test
    }
}
DarkLite1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentation Needed in this repoDocumentation is needed in this repoDocumentation is needed in this repoIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

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