Write-Host
Write-Host is a PowerShell cmdlet that writes content directly to the host interface and information stream.
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
Write-Host is a PowerShell cmdlet that writes text to the host application's screen and to the information stream.
- How it is used
- Displays administrative or script messages directly to the hosting application while also recording them in the information stream.
- How deep it goes
- Explains screen output, pipeline behavior, colors, and information-stream implementation, while deferring broader stream details.
- Examples
- Demonstrates calculated values, interpolated messages, and foreground and background color parameters.
- What you can do after
- Apply Write-Host to display messages, choose supported colors, and control informational output with $InformationPreference.
Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
Write-Host is a PowerShell cmdlet that writes content directly to the host interface and, in PowerShell v5 and later, also routes it through the information stream.
- How it is used
- Distinguishes human-facing host messages from reusable pipeline and Information-stream output.
- How deep it goes
- Explains host behavior, PowerShell 5 stream integration, practical exceptions, and alternatives, but stops short of complete cmdlet syntax.
- Examples
- Uses colored status messages, captured InformationRecord objects, tagged messages, and a contrasting structured-object pipeline example.
- What you can do after
- Evaluate/understand when to replace Write-Host with Write-Information, Write-Progress, or structured pipeline output.
Related concepts
- Write-Informationimplements · Write-Information is a PowerShell cmdlet that writes messages to PowerShell's information stream.
- information streamproduces · The information stream is a PowerShell output stream for informational messages that can be displayed or handled separately from pipeline output.
- cmdletkind of · A cmdlet is a specialized PowerShell command, typically implemented as a .NET class, that performs a focused operation.
- Write-Verbosealternative to · Write-Verbose is a PowerShell cmdlet that writes messages to the verbose output stream.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

