Skip to content

Testing of ForEach-Object -Parallel #2356

Open
@JanElholm

Description

@JanElholm

Checklist

Summary of the feature request

$TimeToSleep = 5
1..10 | ForEach-Object -Parallel {
    $TimeToSleep = $using:TimeToSleep
    Start-Sleep $TimeToSleep
} -ThrottleLimit 5

I would like to be able to mock a function inside of a "ForEach-Object -Parallel". In the above rather contrieved example I would like to be able to mock the Start-Sleep function

Thx

How should it work?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions