liveBook · Manning

Information stream

As explained in Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

The information stream is a PowerShell output channel for informational messages that can be recorded or consumed separately from ordinary pipeline output.

The information stream carries informational messages separately from ordinary pipeline output. Write-Host sends text there while also displaying it directly in the hosting application's screen. section 17.3 section 17.5

Use the stream to understand and control informational output:

  • Write-Host is a wrapper for Write-Information in PowerShell 5 and later, preserving screen display while creating an information-stream record. section 17.3
  • The $InformationPreference variable controls whether Write-Information and Write-Host messages appear; SilentlyContinue suppresses them. section 17.5
  • Hosting applications may route these messages somewhere other than a terminal, such as Application Insights in Azure Functions. section 17.5

Display a message

Run write-host "COLORFUL!" -Foreground yellow -BackgroundColor magenta. The message appears on screen, while its informational output also belongs to the information stream. section 17.3

Figure 17.2 Write-Host bypasses the pipeline and writes directly to the hosting application’s display.

The figure contrasts Write-Host's direct host display with ordinary pipeline behavior. section 17.3

How Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS covers it

How deep it goes
Explains Write-Host behavior, preference-based suppression, hosting differences, and its PowerShell 5 redesign.
Examples
Demonstrates colored Write-Host output and compares terminal display with hosted logging such as Application Insights.
What it assumes
Assumes basic input collection and introduces output streams through practical PowerShell commands.
What you can do after
Apply it via Write-Host, Write-Information, and $InformationPreference to produce or suppress informational messages.
How it connects
Connects information streams with pipelines, Write-Host, Write-Information, preference variables, and the error stream.

Also explained in

Compare how 2 books explain information stream →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS. The section links point to the parts of the book it draws on.