PowerShellで色の付いた文字を出力するには、Write-Host コマンドの -ForegroundColor や -BackgroundColor オプションを使用します。
文字色
以下は、色の出力を確認するためのスクリプト例です。
$colors = @'
Black DarkBlue DarkGreen DarkCyan DarkRed DarkMagenta DarkYellow Gray
DarkGray Blue Green Cyan Red Magenta Yellow White
'@ -split "\s"
foreach ($color in $colors) {
Write-Host $color -ForegroundColor $color
}
実行すると以下のように色付けされます。

背景色
以下は、背景色の出力を確認するためのスクリプト例です (上記の続きです)。
foreach ($color in $colors) {
Write-Host $color -BackgroundColor $color
}
実行すると以下のように色付けされます。

エラー/成功/失敗メッセージを出力するための関数
色の出力を使って、エラーや成功・失敗のメッセージの色を変えることで、コンソールを読みやすくすることができます。 以下は、メッセージ色付け用の関数の例です。
function Write-Error($msg) {
Write-Host "[" -NoNewline
Write-Host "!" -NoNewline -ForegroundColor Red
Write-Host "] " -NoNewline
Write-Host $msg
}
function Write-Success($msg) {
Write-Host "[" -NoNewline
Write-Host "+" -NoNewline -ForegroundColor Green
Write-Host "] " -NoNewline
Write-Host $msg
}
function Write-Failed($msg) {
Write-Host "[" -NoNewline
Write-Host "-" -NoNewline -ForegroundColor Red
Write-Host "] " -NoNewline
Write-Host $msg
}
Write-Error "Test text"
Write-Success "Test text"
Write-Failed "Test text"
実行すると以下のようになります。

以上です。