13 Using all the streams
You may need to flip back a few chapters and refamiliarize yourself with the [CmdletBinding()]
keyword. We can add this to a Param()
block, which turns our function into an advanced function that enables the commands for verbose, warning, informational, and other output. Well, it’s time to put that to use and demonstrate why you’d want to use them.
13.1 Knowing the seven output streams
It’s helpful to understand that PowerShell has seven output streams rather than the one we normally think of. First up, and the one you’re most familiar with, is the Success stream, which you’re used to thinking of as “the end of the pipeline.” This gets some special treatment from the PowerShell engine. For example, it’s the pipeline used ...
Get Learn PowerShell Scripting in a Month of Lunches, Second Edition 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.