liveBook · Manning

InformationAction

As explained in Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools

InformationAction is a PowerShell common parameter that controls information-stream output behavior.

InformationAction controls whether a command displays messages from PowerShell’s structured Information stream. By default, information output is suppressed with SilentlyContinue; Continue enables it for that command. section 13.4

Use InformationAction with related information-stream features:

  • Pair -InformationAction Continue with Write-Information to display messages while testing or running a function. section 13.4
  • Pair -InformationAction SilentlyContinue with -InformationVariable to suppress display while collecting InformationRecord objects for later filtering. section 13.4 section 13.4.1
Function Example {
    [CmdletBinding()]
    Param()
    Write-Information "First message" -tag status
    Write-Information "Note that this had no parameters" -tag notice
    Write-Information "Second message" -tag status
}
Example -InformationAction Continue -InformationVariable x

A tagged function demonstrates visible status and notice messages, variable capture, and command-level InformationAction control. section 13.4

How Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools covers it

How deep it goes
Explains defaults, Continue and SilentlyContinue, variable capture, tagging, and structured records without detailing parameter binding internals.
Examples
Uses tagged status messages, suppressed display, variable capture, and filtering by notice or meta tags.
What it assumes
Assumes PowerShell functions and common parameters, while demonstrating Write-Information and structured message handling.
What you can do after
Operate/configure commands to display, suppress, capture, and filter structured informational messages.
How it connects
Connects Write-Information, InformationVariable, InformationPreference, information streams, and Write-Host.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools. The section links point to the parts of the book it draws on.