O'Reilly logo

PowerShell Deep Dives by Edited by Jeffery Hicks, Richard Siddaway, Oisín Grehan, and Aleksandar Nikoli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Avoiding the pipeline

Jeff Wouters

Whether you’re new to PowerShell or you’re at a more advanced level, I encourage you to always consider performance and execution time when you write a script.

One of the most powerful features of PowerShell is its ability to use the pipeline. Finding objects, filtering them to return the ones you want, and performing an action on those objects is easy to do with pipelined expressions, which I refer to as the pipeline. Every step is one pipe in the pipeline. In general, the fewer pipes you use, the shorter the execution time and the fewer resources that are used.

Although creating one-liners is easy to learn and understand, following best practices yields the best performance. If you don’t implement ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required