October 13th, 2015

PowerTip: Send Message to Information Stream in PowerShell

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to send information for a command to a separate information stream.

Hey, Scripting Guy! Question How can I use Windows PowerShell to send information to a user via a separate information stream,
           without changing the default information preference variable?

Hey, Scripting Guy! Answer In Windows PowerShell 5.0, use the new Write-Information cmdlet, for example:

gps ; Write-Information "process information" -InformationAction continue

Note  gps is an alias for the Get-Process cmdlet.

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.