$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').
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.") …