I expected the following code to print verbose text with my default foreground color:
$Host.PrivateData.VerboseForegroundColor = [console]::ForegroundColor Write-Verbose 'Test' -Verbose However, it prints yellow text as usual. Changing the Error foreground color does work though:
$Host.PrivateData.ErrorForegroundColor = [console]::ForegroundColor Write-Error 'test' The only way I've found to circumvent this is by doing this:
Write-Verbose 'Test' -Verbose *>&1 | Write-Host But this isn't really changing the verbose colors, it's just forcing it to print directly to the console host as default text using Write-Host. I do know that Write-Host does let you alter the message color to anything you want, but this is hardly an ideal solution.


$Host.PrivateData.VerboseForegroundColor = [console]::ForegroundColor.ToString()?(get-host).privatedata.verboseforegroundcolor = 'Gray'works in ps 5 but not ps 7. Using$psstyle.Foreground.Whitedoesn't work. My test isecho hi > there; rm there -v