PowerTip: Maintain PowerShell Objects

Doctor Scripto

Summary: Maintain Windows PowerShell objects in the pipeline.

Hey, Scripting Guy! Question How can I send output to the Windows PowerShell pipeline without changing the formatting or objects, plus
           insure that the output go to the Windows PowerShell console if there is nothing else in the pipeline?

Hey, Scripting Guy! Answer The Write-Output cmdlet sends output to the pipeline or to the console if it is the last command in the pipeline:

Get-Process | Write-Output


Discussion is closed.

Feedback usabilla icon