Leverage Multi-Threading for Speeding Up Your Scripts
summary
Compares concrete methods: Remoting with -ThrottleLimit returns serialized objects unless variables are captured in the script block and runs about one second for the demo, PowerShell Jobs requires custom throttling and averages ~3 seconds, Runspaces uses a runspace pool with min/max and is fastest Runspaces ~0.5s and scales to 70+ Exchange servers across the world in ~30 seconds, ForEach-Parallel requires PowerShell V3 on targets and is inconsistent ForEach-Parallel V3 only Jobs ~3s
AI-written summary · about
chapters (10)
- 0:00Multi-threading in PowerShell
- 1:07Why multi-threading is needed
- 3:35Remoting PowerShell demo
- 4:22Serialized output in remoting
- 7:18PowerShell jobs for multi-threading
- 10:08Runspaces for high performance
- 13:46ForEach-Object Parallel
- 18:02Performance comparison
- 22:12Choosing the right method
- 23:37Resources and Q&A
related talks
34mWhip Your Scripts into Shape: Optimizing PowerShell for Speed
51mPowerShell Techniques and Performance Tweaks - Full Throttle
46mSupercharging PowerShell with LINQ
51mBeyond Arrays: PowerShell Collections for Speed & Scale
01h 33mFinding Performance Bottlenecks with PowerShell
51mFrom PowerCLI to API – Taking Your Automation Skills to...
43mPowerShell Remoting Internals
01h 02mThe performance loop—A practical guide to profiling and benchmarking
