Chapter 19. Troubleshooting pipeline input

Part of what makes PowerShell so unique and powerful is its object-oriented pipeline. When you’re writing tools, it’s especially important that you understand how the pipeline works, how your tools can work within it and—most important of all—that you know how to troubleshoot what’s happening in the pipeline. That’s what this chapter will cover.

19.1. Refresher: how pipeline input works

Whenever you pipe one command to another—say, Get-Service | Where Status –eq 'Running' | Sort Name | Export-CSV services.csv—output is taken from one command and passed to the next. There’s no magic way for that output to be passed along: PowerShell commands can accept input only via their parameters. In this example, ...

Get Learn PowerShell Toolmaking in a Month of Lunches 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.