Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ability to change the colors outputed by Write-* for -Warning, -Debug, -Error and -Verbose #565
Basically this functionality should work as in Windows PowerShell, so this code should produce results WPS behaviour:
$Host.UI.RawUI.BackgroundColor = ($bckgrnd = 'DarkRed') $Host.UI.RawUI.ForegroundColor = 'Cyan' $Host.PrivateData.ErrorForegroundColor = 'Red' $Host.PrivateData.ErrorBackgroundColor = $bckgrnd $Host.PrivateData.WarningForegroundColor = 'Magenta' $Host.PrivateData.WarningBackgroundColor = $bckgrnd $Host.PrivateData.DebugForegroundColor = 'Yellow' $Host.PrivateData.DebugBackgroundColor = $bckgrnd $Host.PrivateData.VerboseForegroundColor = 'Green' $Host.PrivateData.VerboseBackgroundColor = $bckgrnd $Host.PrivateData.ProgressForegroundColor = 'Cyan' $Host.PrivateData.ProgressBackgroundColor = $bckgrnd Write-Host " Write-Host " Write-Verbose " Write-Verbose " -Verbose Write-Error " Write-Error " Write-Warning " Write-Warning "
However since we are running in a HTML styled scenario this can even be improved and we can retrofit the colors for already typed regular Write-Host text.