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.
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 to pass objects from command to command. Additionally, at the end of the pipeline, PowerShell sort of invisibly adds the Out-Default cmdlet, which runs any objects in the pipeline through PowerShell’s formatting system. Whatever hosting application you’re using—the PowerShell console, Visual Studio Code (VS Code), and so on—is responsible for dealing with that output by placing it onto the screen or doing something else.