The PowerShell Pipeline – How to String Cmdlets Together
Almost all operating systems (OSs) have the concept of a pipeline, allowing the output of one process to be fed into the input of the next. This concept is credited to Douglas McIlroy in 1973 when he was working on version 3 of Unix at Bell Labs. This initial implementation envisaged the output of every command as a file-like structure, on which the next command could operate.
This chapter will explain how PowerShell adheres to this vision and differs from it. We’ll start by exploring the pipeline concept, then look at some basic ways of manipulating the contents of the pipeline before taking a medium-depth dive into how the pipeline works in PowerShell, and how we can troubleshoot it when it doesn’t.
By the end of this chapter, we’ll understand how information passes from one cmdlet to the next, how to manipulate that information so that we only work with the stuff we need, and how to work out...