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