PowerShell: Automating Administrative Tasks
by Michael Shepard, Chendrayan Venkatesan, Sherif Talaat, Brenton J.W. Blawat
Piping variables
The concept of piping isn't anything new to the scripting world. Piping, by definition, is directing the output of an object to another object. When you use piping in PowerShell, you are taking the output of one command and sending the data for use with another section of code. The manipulation can be either to a more legible format, or can be by selecting a specific object and digging deeper into those attributes. A pipe is designated by the '|' symbol and is used after you enter a command. The construct of a pipe looks like this: command | ResultManipulation | SortingObjects. If you need to access the individual items in the pipeline, you can leverage the pipeline output $_ command. This tells the pipeline to evaluate the results ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access