GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - powercode/PSParallel: PowerShell module to invoke scriptblocks in parallel runspaces

BranchesTags
Open more actions menu

Latest commit

 

History

72 Commits
72 Commits

Folders and files

NameName
Last commit message
Last commit date
images
images
 
 
module
module
 
 
scripts
scripts
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
PSParallel.sln
PSParallel.sln
 
 
README.md
README.md
 
 

Repository files navigation

PSParallel

Invoke scriptblocks in parallel runspaces

Installation

Install-Module PSParallel
# ping all machines in a subnet
(1..255).Foreach{"192.168.0.$_"} | Invoke-Parallel { [PSCustomObject] @{IP=$_;Result=ping.exe -4 -a -w 20 $_}}

Variables and functions are captured from the parent session.

Throttling

To control the degree of parallelism, i.e. the number of concurrent runspaces, use the -ThrottleLimit parameter

# process lots of crash dumps
Get-ChildItem -Recurse *.dmp | Invoke-Parallel -ThrottleLimit 64 -ProgressActivity "Processing dumps" {
   [PSCustomObject] @{ Dump=$_; Analysis = cdb.exe -z $_.fullname -c '"!analyze -v;q"'
  }

The overhead of spinning up new PowerShell classes is non-zero. Invoke-Parallel is useful when you have items with high latency or that is long running.

image

Contributions

Pull requests and/or suggestions are more than welcome.

Acknowledgements

The idea and the basis for the implementation comes from RamblingCookieMonster. Kudos for that implementation also goes to Boe Prox(@proxb) and Sergei Vorobev(@xvorsx).

About

PowerShell module to invoke scriptblocks in parallel runspaces

Resources

Readme
MIT license
Activity

Stars

54 stars

Watchers

11 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.