3.2. Object-Based Pipelines

Now that you've seen some of the serious limitations in passing text between commands, we can focus on a solution that will eliminate the need to do so using PowerShell's approach to pipelining. PowerShell postulates that each command—in PowerShell parlance, cmdlet—will be a .NET object that satisfies a contract and has a standard interface. Building on .NET allows the shell to pass .NET objects instead of text. This thing is huge! It means that we no longer have to generate parsable text, nor do we have to parse text coming from another program. The pipeline is not a text stream; it is a full-blown collection containing real, live objects. Those objects expose a set of properties and methods that already contain ...

Get Pro Windows PowerShell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.