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
-Verboseand-Debug. When used with theWrite-VerboseandWrite-Debugcmdlets they will display informational messages to the user of your functions. In this post, we’ll focus on theVerboseswitch. The next post in the series will examine theDebugswitch.
Click through for examples of how this can be useful.