Windows Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Runspace07 Sample

This sample shows how to create a runspace, and then use that runspace to run two cmdlets synchronously by using a PowerShell object.


This sample requires Windows PowerShell 2.0.


This sample demonstrates the following.

  • Creating a Runspace object by using the RunspaceFactory class.

  • Creating a PowerShell object that uses the runspace.

  • Adding cmdlets to the pipeline of the PowerShell object.

  • Running the cmdlets synchronously.

  • Extracting properties from the PSObject objects returned by the command.


This sample creates a runspace that used by a PSObject object to run the Get-Process and Measure-Object cmdlets.

See Also

Community Additions

© 2015 Microsoft