Skip to content

Releases: santisq/PSParallelPipeline

v1.2.0

09 Jul 04:07
bca6ae7
Compare
Choose a tag to compare

What's Changed

  • This version version improves the logic of the RunspacePool when re-using runspaces. Prior version would be creating runspaces when it may not be needed, for example, when a parallel invocation ends instantly.

Full Changelog: v1.1.9...v1.2.0

v1.1.9

03 Jul 17:40
Compare
Choose a tag to compare

What's Changed

  • Fixes a bug where the cmdlet would not be correctly disposing Runspaces in scenarios where a PipelineStoppedException was thrown (CTRL+C / Select-Object -First) and OperationCanceledException (Timeout reached) by @santisq in #38

Full Changelog: v1.1.8...v1.1.9

v1.1.8

26 Jun 19:02
Compare
Choose a tag to compare

What's Changed

  • Fixes a bug where the cmdlet would not be correctly disposing Runspaces in scenarios where a PipelineStoppedException was thrown (CTRL+C / Select-Object -First) and OperationCanceledException (Timeout reached) by @santisq in #36

Full Changelog: v1.1.7...v1.1.8

v1.1.7

24 Jun 03:15
Compare
Choose a tag to compare

What's Changed

  • Updates build process by @santisq in #32

  • Fixes incorrect error message on passed ScriptBlock by -Variables by @santisq in #34

    • Invoke-Parallel v1.1.6

    PS \> $null | Invoke-Parallel { $var } -Variables @{ var = {} }
    # Invoke-Parallel: A $using: variable cannot be a script block. Passed-in script block variables are not supported, and can result in undefined behavior.
    • Invoke-Parallel v1.1.7

    PS \> $null | Invoke-Parallel { $var } -Variables @{ var = {} }
    # Invoke-Parallel: Passed-in script block variables are not supported, and can result in undefined behavior.

Full Changelog: v1.1.6...v1.1.7

v1.1.6

18 Jun 04:24
82e804f
Compare
Choose a tag to compare

What's Changed

v1.1.6 Details

Re-implements Invoke-Parallel in C#. This new version shares the same capabilities as the previous one and offers the following improvements:

Pipeline streaming capabilities

Invoke-Parallel v1.1.5

Measure-Command {
    1 | Invoke-Parallel { 0..10 | ForEach-Object { Start-Sleep 1; $_ } } | Select-Object -First 1
} | Select-Object TotalSeconds

# TotalSeconds
# ------------
#       11.10

Invoke-Parallel v1.1.6

Measure-Command {
    1 | Invoke-Parallel { 0..10 | ForEach-Object { Start-Sleep 1; $_ } } | Select-Object -First 1
} | Select-Object TotalSeconds

# TotalSeconds
# ------------
#        1.06

Support for CommonParameters

ForEach-Object v7.5.0.3

This is something missing on ForEach-Object -Parallel as of v7.5.0.3.

PS \> 0..5 | ForEach-Object -Parallel { Write-Error $_ } -ErrorAction Stop
# ForEach-Object: The following common parameters are not currently supported in the Parallel parameter set:
# ErrorAction, WarningAction, InformationAction, PipelineVariable

Invoke-Parallel v1.1.6

A few examples, they should all work properly, please submit an issue if not 😅.

PS \> 0..5 | Invoke-Parallel { Write-Error $_ } -ErrorAction Stop
# Invoke-Parallel: 0

PS \>  0..5 | Invoke-Parallel { Write-Warning $_ } -WarningAction Stop
# WARNING: 1
# Invoke-Parallel: The running command stopped because the preference variable "WarningPreference" or common parameter is set to Stop: 1

PS \> 0..5 | Invoke-Parallel { $_ } -PipelineVariable pipe | ForEach-Object { "[$pipe]" }
# [0]
# [1]
# [5]
# [2]
# [3]
# [4]

Input Script Block check

This check was missing in previous version.

PS \> { 1 + 1 } | Invoke-Parallel { & $_ }
# Invoke-Parallel: Piped input object cannot be a script block. Passed-in script block variables are not supported, and can result in undefined behavior.

Improved Script Block checks for variables passed in via $using: keyword

Invoke-Parallel v1.1.5

PS \> $var = @{ foo = @{ bar = { 1 + 1 } }}
PS \> 1 | Invoke-Parallel { & $using:var['foo']['bar'] }
# 2

Invoke-Parallel v1.1.6

PS \> $var = @{ foo = @{ bar = { 1 + 1 } }}
PS \> 1 | Invoke-Parallel { & $using:var['foo']['bar'] }
# Invoke-Parallel: A $using: variable cannot be a script block. Passed-in script block variables are not supported, and can result in undefined behavior.

Improved -TimeOutSeconds error message

Invoke-Parallel v1.1.5

PS \> 0..10 | Invoke-Parallel { $_; Start-Sleep 5 } -TimeoutSeconds 3
# Invoke-Parallel: The pipeline has been stopped.
# Invoke-Parallel: The pipeline has been stopped.
# Invoke-Parallel: The pipeline has been stopped.
# Invoke-Parallel: The pipeline has been stopped.
# Invoke-Parallel: The pipeline has been stopped.

Invoke-Parallel v1.1.6

PS \> 0..10 | Invoke-Parallel { $_; Start-Sleep 5 } -TimeoutSeconds 3
# 0
# 1
# 3
# 2
# 4
# Invoke-Parallel: Timeout has been reached.

Accept $null as input

Same as ForEach-Object -Parallel, now you can pipe $null to this cmdlet.

PS \> $null | Invoke-Parallel { 'hi' }
# hi

New parameter aliases

Parameter Alias
ThrottleLimit tl
TimeOutSeconds to
Variables vars
Functions funcs
UseNewRunspace unr

Full Changelog: v1.1.5...v1.1.6

v1.1.5

05 Apr 18:24
Compare
Choose a tag to compare

What's Changed

  • Add support for member accessing on using: statements by @santisq in #21

This release adds support to properly handle property and index accessing on using: statements. v1.1.4 added support for index accessing however accessing of properties was not working properly. This release fixes that, including nested accessing. Example:

$test = @{
    foo = @{
        bar = [pscustomobject]@{ baz = 0..10 }
    }
}

1 | Invoke-Parallel { $using:test['foo']['bar'].baz[5] } # Outputs: 5

Full Changelog: v1.1.4...v1.1.5

v1.1.4

25 Jan 20:34
Compare
Choose a tag to compare

What's Changed

  • Fixes indexing on $using: statements by @santisq in #18

    This update allows proper index on $using: statements, for example:

    $arr = 0..10; $hash = @{ foo = 'bar' }
    1 | Invoke-Parallel { $using:hash['foo'] + ' ' + $using:arr[5] + $_ }
    
    # Outputs:
    # bar 51

    In previoues version this would fail with:

    Invoke-Parallel: Exception calling "GetValue" with "1" argument(s): "Cannot process argument because the value of argument "path" is not valid. Change the value of the "path" argument and run the operation again."

    Thanks to @jborean93 for catching and helping fixing this bug.

Full Changelog: v1.1.3...v1.1.4

v1.1.3

04 Aug 19:46
46c9d32
Compare
Choose a tag to compare

What's Changed

  • Added check to validate if a scriptblock is being passed to the parallel scope either through using: scope modifier or -Varables parameter. In both cases there will be a terminating error.
  • Added pester tests.

Full Changelog: v.1.1.2...v1.1.3

v.1.1.2

28 Jun 01:24
1da5fd5
Compare
Choose a tag to compare

What's Changed

  • Added Pester tests.
  • Few code improvements.
  • Added build script and improved CI pipeline.
  • Updated docs and readme.

Full Changelog: v1.1.1...v.1.1.2

v1.1.1

18 Apr 17:59
Compare
Choose a tag to compare

What's Changed

Updated ValidateRange attribute declaration of -ThrottleLimit parameter to have a max value of 63. This is due to a limitation of WaitHandle.WaitAny Method allowing a maximum of 63 concurrent handles on STA State. Previously -ThrottleLimit would allow a maximum of int.MaxValue threads.

Full Changelog: v1.1.0...v1.1.1