RunspaceFactory.CreateRunspacePool Method (Int32, Int32, RunspaceConnectionInfo)
Assembly: System.Management.Automation (in System.Management.Automation.dll)
public: static RunspacePool^ CreateRunspacePool ( int minRunspaces, int maxRunspaces, RunspaceConnectionInfo^ connectionInfo )
public static RunspacePool CreateRunspacePool ( int minRunspaces, int maxRunspaces, RunspaceConnectionInfo connectionInfo )
public static function CreateRunspacePool ( minRunspaces : int, maxRunspaces : int, connectionInfo : RunspaceConnectionInfo ) : RunspacePool
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.
The maximum number of runspaces that are allowed to be open. Set to a value greater than the minRunspaces parameter.
An object that derives from the RunspaceConnectionInfo abstract class. This object defines the information used to connect to a specific computer.
Return ValueReturns a RunspacePool object that represents the pool with the maximum number of runspaces, the minimum number of runspaces maintained open, and the specified connection information used when a runspace from the pool is open.
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.