liveBook · Manning

Chapter 10: The pipeline, deeper

What you will learn in chapter 10 of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

This introduction illustrates how a PowerShell pipeline can accomplish a multi-step task in one line and previews a deeper look at passing data between commands.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction illustrates how a PowerShell pipeline can accomplish a multi-step task in one line and previews a deeper look at passing data between commands.

Key terms: pipeline, Get-Process, Sort-Object, ConvertTo-Html, Out-File

10.1 The pipeline: Enabling power with less typing

This section explains why learning to use PowerShell’s pipeline can make administrators more effective with less typing and less need for scripts.

Key terms: PowerShell pipeline, one-line commands, scripts

10.2 How PowerShell passes data down the pipeline

The section explains how PowerShell connects one command’s output to another command’s input through pipeline parameter binding.

Key terms: pipeline parameter binding, ByValue, ByPropertyName, Command A, Command B

10.3 Plan A: Pipeline input ByValue

Explains how PowerShell binds pipeline objects to parameters ByValue, how to check whether a match is useful, and when ByValue fails.

Key terms: pipeline parameter binding, ByValue, Get-Member, Get-Help, type of object, Get-Content, System.String, Get-Command, Get-Module, -Name

10.4 Plan B: Pipeline input ByPropertyName

This section explains how PowerShell connects pipeline object properties to accepting parameters by name, then shows why matching names alone may not produce a useful result.

Key terms: pipeline input ByPropertyName, property, parameter, Get-Member, Get-ChildItem, Stop-Process, Name, -Name, Import-Csv, New-Alias

10.5 When things don’t line up: Custom properties

Shows how to reshape imported CSV objects with custom properties so their names match a cmdlet’s ByPropertyName pipeline parameters.

Key terms: ByPropertyName, Import-CSV, New-ADUser, Department, samAccountName, Name, Select-Object, -Property, hash table, Expression

10.6 Working with Azure PowerShell

This section shows how to prepare and connect Azure PowerShell for the rest of the chapter.

Key terms: Azure subscription, Az module, Connect-AzAccount, Select-AzSubscription, SubscriptionName

10.7 Parenthetical commands

This section shows how a parenthetical command can supply values directly to a parameter when pipeline binding does not send them where intended.

Key terms: parenthetical command, pipeline parameter binding, -Module, -Name, String objects

10.8 Extracting the value from a single property

This section shows how to extract a property’s value so a parenthetical command can supply the string another cmdlet expects.

Key terms: PSResourceGroup, String, ResourceGroupName, Select-Object, -ExpandProperty, -Property, PSCustomObject

10.9 Lab

10.10 Lab answers

10.11 Further exploration

This section encourages readers to revisit the pipeline examples and compare two commands’ output, without explaining the difference.

Where this is used later

Concepts explained in this chapter

← Chapter 9: A practical interlude Chapter 11: Formatting: And why it’s done on the right →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.