Reputation: 32758
I have tried this:
# Set-ExecutionPolicy Unrestricted
$VerbosePreference = 'Continue'
Write-Verbose "ABC"
$DebugPreference = "Continue"
Write-Debug "Something went wrong."
But both messages come either with the word: VERBOSE or DEBUG before the actual message.
Is there a way I can just display the message content only?
Upvotes: 0
Views: 220
Reputation: 201592
Write-Host
is what you would use to write a message to the host. Note that in V4 and below, you can't capture this sort of output to a log file. Starting with V5, you can capture host messages because Write-Host has been updated to use the new Information stream. Likewise in V5, you could just use Write-Information
directly.
Upvotes: 1