Skip to Content
Learn PowerShell in a Month of Lunches, Fourth Edition
book

Learn PowerShell in a Month of Lunches, Fourth Edition

by Tyler Leonhardt, Travis Plunk, James Petty
May 2022
Beginner content levelBeginner
360 pages
10h 10m
English
Manning Publications
Content preview from Learn PowerShell in a Month of Lunches, Fourth Edition

6 The pipeline: Connecting commands

In chapter 4, you learned that running commands in PowerShell is the same as running commands in any other shell: you type a cmdlet name, give it parameters, and press Enter. What makes PowerShell special isn’t the way it runs commands but the way it allows multiple commands to be connected to each other in powerful, one-line sequences.

6.1 Connecting one command to another: Less work for you

PowerShell connects commands to each other by using a pipeline. The pipeline provides a way for one command to pass, or pipe, its output to another command, allowing that second command to have something to work with. This can be seen with the vertical bar | between two cmdlets (figure 6.1).

Figure 6.1 Showing the pipe ...

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.
Start your free trial

You might also like

PowerShell for Sysadmins

PowerShell for Sysadmins

Adam Bertram

Publisher Resources

ISBN: 9781617296963Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link