There is also Write-Verbose which writes to the verbose message stream. Reading about_CommonParameters shows that
-Verbose is a Common Parameter, like
-Debug and they can both be used with functions to control output. In Use PowerShell to Write Verbose Output - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs this topic is discussed further. I have tried using
-verbose on my whole script as in ps - Powershell script support for -verbose - Stack Overflow but had issues when my function also defined this use, so more work is needed here. In theory about_Functions_CmdletBindingAttribute should help.