jhorsman
9/19/2017 - 10:24 AM

Write-Verbose for Octopus

Write-Verbose for Octopus

# CAUTION !  this function overwrites PowerShell's built in Write-Verbose commandlet

function Write-Verbose([string]$message) {
    # we should use `Write-verbose "this is verbose"` but Octopus does not capture verbose output
    # also see https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/10092630-verbose-logging-of-powershell-script
    if($VerbosePreference -eq "Continue") {
        Write-Host "VERBOSE: $message"
    }
}