Powershell/C#: Invoking a pipeline asynchronously & displaying the results

前端 未结 2 961
孤独总比滥情好
孤独总比滥情好 2020-12-20 09:59

As per this sample - http://msdn.microsoft.com/en-us/library/windows/desktop/ee706590(v=vs.85).aspx,

I am trying to invoke my script in an async way. But, at the sa

2条回答
  •  感动是毒
    2020-12-20 10:41

    If you only want to output Write-Verbose output to the GUI then it would be easier to monitor the Streams.Verbose collection after the InvokeAsync. If you want to scan all the output then use the PipelineReader. Subscribe to its DataReady event and in that event handler do a NonBlockingRead to get the data.

提交回复
热议问题