File tree 4 files changed +11
-6
lines changed
4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
# PSParallel
2
+
2
3
Invoke scriptblocks in parallel runspaces
3
4
4
5
## Installation
6
+
5
7
``` PowerShell
6
8
Install-Module PSParallel
7
9
```
@@ -14,11 +16,12 @@ Install-Module PSParallel
14
16
Variables and functions are captured from the parent session.
15
17
16
18
## Throttling
19
+
17
20
To control the degree of parallelism, i.e. the number of concurrent runspaces, use the -ThrottleLimit parameter
18
21
19
22
``` PowerShell
20
23
# process lots of crash dumps
21
- Get-ChildItem -recurce *.dmp | Invoke-Parallel -ThrottleLimit 64 -ProgressActivity "Processing dumps" {
24
+ Get-ChildItem -Recurse *.dmp | Invoke-Parallel -ThrottleLimit 64 -ProgressActivity "Processing dumps" {
22
25
[PSCustomObject] @{ Dump=$_; Analysis = cdb.exe -z $_.fullname -c '"!analyze -v;q"'
23
26
}
24
27
```
@@ -28,8 +31,10 @@ The overhead of spinning up new PowerShell classes is non-zero. Invoke-Parallel
28
31
![ image] ( https://github.com/powercode/PSParallel/raw/master/images/Invoke-Parallel.png )
29
32
30
33
## Contributions
34
+
31
35
Pull requests and/or suggestions are more than welcome.
32
36
33
- ### Acknowlegementes
37
+ ### Acknowledgements
38
+
34
39
The idea and the basis for the implementation comes from [ RamblingCookieMonster] ( https://github.com/RamblingCookieMonster ) .
35
- Cudos for that implementation also goes to Boe Prox(@proxb ) and Sergei Vorobev(@xvorsx ).
40
+ Kudos for that implementation also goes to Boe Prox(@proxb ) and Sergei Vorobev(@xvorsx ).
Original file line number Diff line number Diff line change 1
- $manPath = Get-ChildItem - recurse $PSScriptRoot / ../ module - include * .psd1 | select - first 1
1
+ $manPath = Get-ChildItem - recurse $PSScriptRoot / ../ module - include * .psd1 | Select-Object - first 1
2
2
$man = Test-ModuleManifest $manPath
3
3
4
4
$name = $man.Name
Original file line number Diff line number Diff line change 1
- $manPath = Get-ChildItem - recurse $PSScriptRoot / ../ module - include * .psd1 | select - first 1
1
+ $manPath = Get-ChildItem - recurse $PSScriptRoot / ../ module - include * .psd1 | Select-Object - first 1
2
2
$man = Test-ModuleManifest $manPath
3
3
4
4
$name = $man.Name
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ $philosopherData = @(
35
35
36
36
$pd = $philosopherData [($_ -1 )% $philosopherData.Count ]
37
37
38
- 1 .. 100 | foreach {
38
+ 1 .. 100 | ForEach-Object {
39
39
$op = switch ($_ % 8 )
40
40
{
41
41
0 { ' sleeping' }
You can’t perform that action at this time.
0 commit comments