Search notes:

PowerShell cmdLet: Write-Host

Bypass the pipeline

write-host writes a string or a text representation of the cmdlet's arguments directly (aka asynchronously) to the host's console, that is without putting them into the pipeline.
This behaviour is demonstrated with the following simple pipeline: an array of three strings, 'one', 'two' and three' is piped into a foreach-object cmdlet whose script block evaluates the the incoming objects (strings).
If the strings ends in o (as is the case for two), then a string is written directly to the host (write-host).
If it starts with an o, a string is written with write-output, which essentially passes the string down the pipeline.
Otherwise, the string is passed down the pipeline unmodified.
The result of the entire pipeline is assigned to the variable $pipelineResult:
$pipelineResult = 'one', 'two', 'three' | foreach-object {
   if ($_ -match 'o$') {
      write-host "$_ ends in o"
   }
   elseif ($_ -match '^o') {
      write-output "$_ begins with o"
   }
   else {
      $_
   }
}

''
'pipelineResult:'
$pipelineResult
Github repository about-PowerShell, path: /cmdlets/host/write/pipeline.ps1
When executing this example, it prints:
two ends in o

pipelineResult:
one begins with o
three
See also this example which essentially demonstrates the same.

Colored output

With the cmdLet's -foregroundColor and -backgroundColor options, it's possible to write colored output:
write-host "Text..."
write-host "`nWarning: end of string reached.`n" -foregroundColor yellow -backgroundColor red
write-host "...Text"
Github repository about-PowerShell, path: /cmdlets/host/write/color.ps1
The script, when executed, prints:

Write-host considered harmful

Because write-host does not pass objects down the pipeline, Jeffrey Snover, the inventor of PowerShell, reminds his audience on his blog that using write-host is almost always wrong and that write-output should be used instead.
The reason that Jeffrey Snover disourages the use of write-host is because write-host directly writes to the console without a possibility to redirect the output into a log file or to use the output further down a pipeline.
However, as per this blog post by Ed Wilson, write-host is being redeemed because write-information provides the good stuff of write-host without its problems.

See also

Compare with out-host which does not render an object.
The powershell command noun host and verb write.
write-textInConsoleErrorColor and write-textInConsoleWarningColor (found in my PowerShell module console).

Index