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.

RunspaceFactory.CreateRunspacePool Method (Int32, Int32, RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)


Updated: April 27, 2016

Applies To: Windows PowerShell

Creates a runspace pool that contains runspaces that can be opened on a remote computer. The runspace pool specifies the minimum number of runspaces that Windows PowerShell maintains open, the maximum number of runspaces in the pool, a custom host, connection information, type table (serialization) information, and endpoint application arguments. This method is introduced in Windows PowerShell 2.0.

Namespace:   System.Management.Automation.Runspaces
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

public static RunspacePool CreateRunspacePool(
	int minRunspaces,
	int maxRunspaces,
	RunspaceConnectionInfo connectionInfo,
	PSHost host,
	TypeTable typeTable,
	PSPrimitiveDictionary applicationArguments


Type: System.Int32

The minimum number of opened runspaces that Windows PowerShell maintains open even if the runspaces are no longer needed (default is one). Typically, Windows PowerShell destroys opened runspaces when they are no longer needed.

Type: System.Int32

The maximum number of runspaces that are allowed to be open. Set to a value greater than the minRunspaces parameter.

Type: System.Management.Automation.Runspaces.RunspaceConnectionInfo

An object that derives from the RunspaceConnectionInfo abstract class. This object defines the information used to connect to a specific computer.

Type: System.Management.Automation.Host.PSHost

A PSHost object that represents the host that provides communications between Windows PowerShell and the user.

Type: System.Management.Automation.Runspaces.TypeTable

A TypeTable object that contains information used to serialize and deserialize objects passed between computers.

Type: System.Management.Automation.PSPrimitiveDictionary

A PSPrimitiveDictionary object that contains the application arguments for the endpoint on the remote computer.

Return Value

Type: System.Management.Automation.Runspaces.RunspacePool

Returns a RunspacePool object that represents the pool whose runspaces use the specified initial session state.

A runspace pool is a set of runspaces that have the same features, such as the same host, initial session state, and connection information. A runspace from the pool is the operating environment used when invoking the commands of a pipeline. After the runspace pool is created, a runspace from the pool must be opened by using one of the following methods before it can be used:

  • To open a runspace from the pool synchronously, call the Open method.

  • To open a runspace from the pool asynchronously, call the BeginOpen method.

Return to top

Community Additions