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
