You want a script to show friendly status messages, maybe in green or red, without those messages leaking into the data it returns. That’s exactly the job Write-Host was built for.
Quick answer: PowerShell Write-Host prints text straight to the console (the host), with optional -ForegroundColor, -BackgroundColor, -NoNewline and -Separator. It doesn’t send objects down the pipeline:
Write-Host 'Backup finished' -ForegroundColor Green
We’ll walk through text and variables, colors, same-line output, arrays, objects, the information stream, transcripts and ANSI styling, and point out where PowerShell 7 and Windows PowerShell 5.1 disagree.
What You Need Before You Start
Any PowerShell version works and no admin rights are needed. We tested in PowerShell 7.6 and Windows PowerShell 5.1 in a normal console window. If you’re unsure which output cmdlet fits your script, our Write-Host vs Write-Output comparison answers that in two minutes.
Step 1: Print Text and Variables With Write-Host
Write-Host takes one or more objects and shows their text. Double quotes expand variables, and $() evaluates an expression such as a property. Several unquoted arguments are joined with a single space:
$name = 'Maria Lopez'
$order = [pscustomobject]@{ Id = 1001; City = 'Austin' }
Write-Host 'Nightly report started'
Write-Host "Prepared for $name"
Write-Host "Order $($order.Id) ships to $($order.City)"
Write-Host ('Total: USD {0:N2}' -f 1250.5)
Write-Host 'Items:' 3 'Status:' 'Ready'
Output:
Nightly report started
Prepared for Maria Lopez
Order 1001 ships to Austin
Total: USD 1,250.50
Items: 3 Status: Ready
The -f format operator is handy for numbers, like the USD total above. For more ways to show values inside sentences, see printing variables in PowerShell.
Step 2: Add Color With -ForegroundColor and -BackgroundColor
Both parameters take a ConsoleColor value. There are 16 of them: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow and White. Here’s a simple status report:
Write-Host 'PASSED Denver backup' -ForegroundColor Green
Write-Host 'WARNING Seattle disk almost full' -ForegroundColor Yellow
Write-Host 'FAILED Austin file sync' -ForegroundColor White -BackgroundColor DarkRed
Write-Host 'Colors available:' ([enum]::GetNames([ConsoleColor]).Count)
Output:
PASSED Denver backup
WARNING Seattle disk almost full
FAILED Austin file sync
Colors available: 16

A name outside that list, such as Orange, fails with a parameter binding error in both shells. Our Write-Host color guide covers color tables and per-word coloring.
Step 3: Keep Output on One Line With -NoNewline
-NoNewline leaves the cursor at the end of the text, so the next Write-Host continues on the same line. That’s how you build a check list with a colored result:
foreach ($city in 'Austin', 'Denver', 'Seattle') {
Write-Host "Checking $city... " -NoNewline
Write-Host 'OK' -ForegroundColor Green
}
Write-Host 'a', 'b', 'c' -NoNewline
Write-Host ' <- spaces kept'
Output:
Checking Austin... OK
Checking Denver... OK
Checking Seattle... OK
a b c <- spaces kept
Look at the last line. Microsoft’s parameter description says -NoNewline joins several objects with no spaces, yet both shells kept the single space in our runs. Use -Separator ” or build the text first when the exact spacing matters, as shown in concatenating strings in PowerShell.