Getting Write-Verbose messages output to show up in PowerShell module script code Getting Write-Verbose messages output to show up in PowerShell module script code powershell powershell

Getting Write-Verbose messages output to show up in PowerShell module script code


So somewhere in the mix the Import-Module is changing the VerbosePreference on you. If you do something like this you should see your messages.

$VerbosePreference = "Continue"Write-Verbose "Your Verbose Messages Here"$VerbosePreference = "SilentlyContinue"

You could probably get away with setting it to Continue at the top, and Silence it at the bottom of your psm1 file.