Whip Your Scripts into Shape: Optimizing PowerShell for Speed
summary
Demo-heavy session that actually measures results: uses Stopwatch vs Measure-Command and runs each case 100 times, dropping fastest and slowest. Shows concrete speedups — console output removal saves ~13 ms, filtering with WinEvent drops 2.5 s to ~15 ms, replacing pipeline aliases nearly halves runtime, switching pipeline ForEachObject to language foreach gives ~33% faster, using ArrayList Add method avoids reallocations, and PoshRSJob parallelization turns an ~8 s sequence into ~2 s. Tools: PoshRSJob, PowerShell Universal Dashboard, EventToast.
AI-written summary · about
chapters (12)
- 0:00Introduction and context
- 1:08Testing methodology
- 6:56Reducing console chatter
- 8:31Filtering for efficiency
- 10:34Optimizing commands
- 13:31Working with filesystems
- 15:35Efficient loops
- 16:55Optimizing data handling
- 18:50DotNet and overhead
- 20:20Collection methods
- 23:00Parallel processing
- 25:37Conclusion and takeaways
related talks
51mPowerShell Techniques and Performance Tweaks - Full Throttle
43mParallel Execution with PowerShell
27mLeverage Multi-Threading for Speeding Up Your Scripts
51mBeyond Arrays: PowerShell Collections for Speed & Scale
46mSupercharging PowerShell with LINQ
01h 33mFinding Performance Bottlenecks with PowerShell
41mPowerShell for Life: Automate the Everyday
51mFrom PowerCLI to API – Taking Your Automation Skills to...
