Monday, May 3, 2010

Writing Debug (-Verbose) Output in PowerShell

To write output in PowerShell that is only displayed when the -Verbose switch is given, use the following attribute in your script:
[CmdletBinding]

Then use write-verbose.

This makes the function an Advanced Function.

0 comments:

Post a Comment