Skip to content

Releases: santisq/PSParallelPipeline

v1.2.5

14 Jul 23:07
6d13e2a

Choose a tag to compare

What's Changed

  • Fixed duplicate module names in completion class due to version differences. Values now sorted lexicographically. Ref Issue: #51.

Full Changelog: v1.2.4...v1.2.5

v1.2.4

14 Jul 15:32
fc4efdf

Choose a tag to compare

What's Changed

This update enhances Invoke-Parallel with new parameters for easier module management. See PR #49 and Issue #48 for details.

  • -ModuleNames Parameter: Import system-installed modules into parallel runspaces by name, using modules discoverable via $env:PSModulePath.

    Import-Csv users.csv | Invoke-Parallel { Get-ADUser $_.UserPrincipalName } -ModuleNames ActiveDirectory
    # Imports ActiveDirectory module for Get-ADUser
  • -ModulePaths Parameter: Import custom modules from specified directory paths into parallel runspaces.

    $moduleDir = Join-Path $PSScriptRoot "CustomModule"
    0..10 | Invoke-Parallel { Get-CustomCmdlet } -ModulePaths $moduleDir
    # Imports custom module for Get-CustomCmdlet

Full Changelog: v1.2.3...v1.2.4

v1.2.3

19 Mar 19:39

Choose a tag to compare

What's Changed

  • Added ConfigureAwait(false) to all await statements for improved performance in asynchronous operations.
  • Included minor code improvements for better maintainability and efficiency, with no impact on module usage or functionality.

Details

Full Changelog

v1.2.2...v1.2.3

v1.2.2

24 Jan 21:15
c972bf5

Choose a tag to compare

What's Changed

  • Lot of refactoring done to the cmdlet to improve responsiveness and efficiency.

  • The cmdlet now throws when passing a function that could not be found in the user's scope.

    PS ..\> Invoke-Parallel { } -Function NotExist
    Invoke-Parallel: The function with name 'NotExist' could not be found.

Full Changelog: v1.2.1...v1.2.2

v1.2.1

20 Jan 14:50
22b0f30

Choose a tag to compare

What's Changed

  • Updates manifest Description and a bit of code refactoring by @santisq in #43

Full Changelog: v1.1.20...v1.2.1

v1.2.0

09 Jul 04:07
bca6ae7

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

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

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

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

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