Pipeline.Invoke Method ()
Updated: April 27, 2016
Applies To: Windows PowerShell
Invokes the pipeline synchronously.
Assembly: System.Management.Automation (in System.Management.Automation.dll)
When this method is used to invoke the pipeline, the Windows PowerShell runtime closes the Input pipe.
This method cannot be called when another pipeline is running.
This method cannot be called multiple times on a given pipeline. The state of the pipeline must be NotStarted when is called. When this method is called, it changes the state of the pipeline to Running. When is completed, it changes the state of the pipeline to one of following:
Applications can get notified about pipeline state changes by registering for the StateChanged event. This event is raised each time the state of the pipeline changes.
Here is an example of calling this method after the pipeline is created.
Pipeline pipeLine = myRunSpace.CreatePipeline("GetProcPSSnapIn01\\get-proc"); Collection<PSObject> results = pipeLine.Invoke();
For an example of applications that use this class, see: