concept steppable pipeline in category powershell

appears as: steppable pipeline, Steppable pipelines
Windows PowerShell in Action, Third Edition

This is an excerpt from Manning's book Windows PowerShell in Action, Third Edition.

So far, we’ve covered scriptblocks, modules, and closures in PowerShell. Although these features are somewhat exotic, they’re found in most modern (or modernized) languages, including Java, JavaScript, Visual Basic, C#, and Python. In the next section, we’re going to cover a related feature that’s unique to PowerShell: steppable pipelines. Normally once a pipeline starts, it runs to completion. With a steppable pipeline, you can cause the pipeline to process one object at a time (with some limitations). This is a concrete form of metaprogramming, where one script has precise control over the sequence of operations in another.

10.5.2. Creating a proxy command with steppable pipelines

In chapter 1, we discussed how the result of all of the things we type at the command line are streamed through Out-Default to display them on the screen. Out-Default uses steppable pipelines to run the formatter cmdlets to do its rendering and then calls Out-Host to display the formatted output. Let’s see how you can add a frequently requested feature to the interactive experience using a proxy for Out-Default.