PowerShell Pipeline

A pipeline is defined in www.TheFreeDictionary.com as follows:

"a linked series of pipes with pumps and valves for flow control, used to transport crude oil, water, etc., esp. over great distances."

I think this definition is very fitting to a pipeline in PowerShell. Instead of crude oil or water, what PowerShell transports is pieces of information. PowerShell also has these pumps and valves for flow control—we will see more of these in the later chapters.

The pipe symbol in PowerShell is |, also called a bar. You can pipe multiple cmdlets together. When you pipe these cmdlets, the output of one cmdlet becomes the input of the next cmdlet:

When you are writing your scripts, you may want to add a new line after the pipe and continue ...

Get PowerShell for SQL Server Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.