You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-69Lines changed: 40 additions & 69 deletions
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,16 @@
10
10
11
11
</div>
12
12
13
+
`PSParallelPipeline` is a PowerShell module featuring the `Invoke-Parallel` cmdlet, designed to process pipeline input objects in parallel. It mirrors the capabilities of [`ForEach-Object -Parallel`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object) from PowerShell 7.0+, bringing this functionality to Windows PowerShell 5.1, surpassing the constraints of [`Start-ThreadJob`](https://learn.microsoft.com/en-us/powershell/module/threadjob/start-threadjob?view=powershell-7.4).
14
+
13
15
PSParallelPipeline is a PowerShell Module that includes `Invoke-Parallel`, a cmdlet that allows for parallel processing of input objects, sharing similar capabilities as
14
16
[`ForEach-Object -Parallel`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object) introduced in PowerShell v7.0.
15
17
16
-
This project was inspired by RamblingCookieMonster's [`Invoke-Parallel`](https://github.com/RamblingCookieMonster/Invoke-Parallel) and is developed with Windows PowerShell 5.1 users in mind where the closest there is to parallel pipeline processing is [`Start-ThreadJob`](https://learn.microsoft.com/en-us/powershell/module/threadjob/start-threadjob?view=powershell-7.4).
17
-
18
-
# What does this Module offer?
18
+
# Why Use This Module?
19
19
20
-
Except for [`-AsJob`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.4#-asjob), this module offers the same capabilities as `ForEach-Object -Parallel`in addition to supporting[Common Parameters](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters), a missing feature in the _built-in_ cmdlet.
20
+
Except for [`-AsJob`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.4#-asjob), `Invoke-Parallel` delivers the same capabilities as `ForEach-Object -Parallel`and adds support for[Common Parameters](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters)—a feature missing from the built-in cmdlet.
21
21
22
-
## Pipeline streaming capabilities
22
+
## Streamlined Pipeline Processing
23
23
24
24
```powershell
25
25
Measure-Command {
@@ -32,109 +32,79 @@ Measure-Command {
32
32
# 1.06
33
33
```
34
34
35
-
## Support for [CommonParameters](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7.4)
35
+
## Common Parameters Support
36
36
37
-
Something missing on `ForEach-Object -Parallel`as of `v7.5.0.3`.
37
+
Unlike `ForEach-Object -Parallel`(up to v7.5), `Invoke-Parallel` supports [Common Parameters](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7.4), enhancing control and debugging.
## [`$using:`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_keywords?view=powershell-7.4) Support
62
+
## [`$using:`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.4#the-using-scope-modifier) Scope Support
95
63
96
-
Same as `ForEach-Object -Parallel` you can use the `$using:`scope modifier to pass-in variables to the parallel invocations.
64
+
Easily pass variables into parallel scopes with the `$using:` modifier, just like `ForEach-Object -Parallel`:
Both parameters are a quality of life addition, specially `-Functions`, which adds the locally defined functions to the runspaces [Initial Session State](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.runspaces.initialsessionstate), a missing feature on `ForEach-Object -Parallel`. This is a much better alternative to passing-in the function definition to the parallel scope.
74
+
These parameters enhance usability by simplifying script management:
Both parameters are quality-of-life enhancements, especially `-Functions`, which adds locally defined functions to the runspaces’ [Initial Session State](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.runspaces.initialsessionstate)—a feature absent in `ForEach-Object -Parallel`. This is a far better option than passing function definitions into the parallel scope.
122
92
123
93
## Documentation
124
94
125
-
Check out [__the docs__](./docs/en-US/Invoke-Parallel.md) for information about how to use this Module.
95
+
Explore detailed usage in [__the docs__](./docs/en-US/Invoke-Parallel.md).
126
96
127
97
## Installation
128
98
129
-
### Gallery
99
+
### PowerShell Gallery
130
100
131
101
The module is available through the [PowerShell Gallery](https://www.powershellgallery.com/packages/PSParallelPipeline):
This module has no requirements and is fully compatible with __Windows PowerShell 5.1__ and [__PowerShell Core 7+__](https://github.com/PowerShell/PowerShell).
117
+
- Compatible with __Windows PowerShell 5.1__ and __PowerShell Core 7+__
118
+
- No external dependencies
148
119
149
120
## Contributing
150
121
151
-
Contributions are more than welcome, if you wish to contribute, fork this repository and submit a pull request with the changes.
122
+
Contributions are more than welcome! Fork the repo, make your changes, and submit a pull request. Check out the [source](./src/PSParallelPipeline/) for more details.
0 commit comments