Search notes:

Powershell module: console: get-textInConsoleXColor

$W = get-textInConsoleWarningColor 'warning'
$E = get-textInConsoleErrorColor   'error'

"text $W text $E text"
"This is $(get-textInConsoleWarningColor bar) and this is $(get-textInConsoleErrorColor 'really bad').

TODO

The functionality of get-textInConsole…Color might also be implemented using something like
write-host ( "This is the $( (Get-PSReadLineOption).ErrorColor)error color$([char] 0x1b)[0m.")
write-host ( "This is the $( (Get-PSReadLineOption).EmphasisColor)emphasis color$([char] 0x1b)[0m.")
…

See also

PowerShell module console

Index