Robert Cain gets verbose on us:
In my previous post, Fun With the PowerShell Switch Parameter, I introduced the use of switches with PowerShell functions. We learned how they work, and how to create your own. For all functions, PowerShell creates a set of switches that are just “built in” to PowerShell. You do not have to explicitly create these yourself, you can simply use them and implement them within your own functions.
Two of the most used are
-Verbose
and-Debug
. When used with theWrite-Verbose
andWrite-Debug
cmdlets they will display informational messages to the user of your functions. In this post, we’ll focus on theVerbose
switch. The next post in the series will examine theDebug
switch.
Click through for examples of how this can be useful.