RunspaceFactory.CreateRunspacePool Method

Definition

Overloads

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo, PSHost, TypeTable)

Creates a RunspacePool on the specified remote runspace compuer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

CreateRunspacePool()

Creates a RunspacePool using default RunspaceConfiguration with MaxRunspaces 1 and MinRunspaces 1.

CreateRunspacePool(InitialSessionState)

Creates a RunspacePool using the supplied initialSessionState. The minimum runspaces size is set to 1. The maximum runspaces size is set to 1.

CreateRunspacePool(Int32, Int32)

Creates a RunspacePool using default RunspaceConfiguration. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

CreateRunspacePool(Int32, Int32, PSHost)

Creates a RunspacePool using the supplied host, minRunspaces and maxRunspaces

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo)

Creates a RunspacePool on the specified remote computer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

CreateRunspacePool(Int32, Int32, InitialSessionState, PSHost)

Creates a RunspacePool using the supplied initialSessionState, minRunspaces and maxRunspaces

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo, PSHost)

Creates a RunspacePool on the specified remote runspace computer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)

Creates a RunspacePool on the specified remote runspace compuer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo, PSHost, TypeTable)

Creates a RunspacePool on the specified remote runspace compuer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo, System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.TypeTable typeTable);
Parameters
minRunspaces
Int32

The minimum number of Runspace that should exist in this pool. Should be greater than 1.

maxRunspaces
Int32

The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

connectionInfo
RunspaceConnectionInfo

RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created

host
PSHost

Host associated with this runspace pool

typeTable
TypeTable

The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer:

  1. SerializationMethod
  2. SerailizationDepth
  3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer:
  4. TargetTypeForDeserializaiton
  5. TypeConverter

    If typeTable is null no custom serialization/deserialization can be done. Default PowerShell behavior will be used in this case.

Returns
Exceptions

Maximum Pool size is less than 1. Minimum Pool size is less than 1.

connectionInfo is null

CreateRunspacePool()

Creates a RunspacePool using default RunspaceConfiguration with MaxRunspaces 1 and MinRunspaces 1.

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool ();
Returns

CreateRunspacePool(InitialSessionState)

Creates a RunspacePool using the supplied initialSessionState. The minimum runspaces size is set to 1. The maximum runspaces size is set to 1.

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (System.Management.Automation.Runspaces.InitialSessionState initialSessionState);
Parameters
initialSessionState
InitialSessionState

initialSessionState to use when creating a new Runspace in the pool.

Returns
Exceptions

RunspaceConfiguration is null.

CreateRunspacePool(Int32, Int32)

Creates a RunspacePool using default RunspaceConfiguration. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces);
Parameters
minRunspaces
Int32

The minimum number of Runspaces that exist in this pool. Should be greater than or equal to 1.

maxRunspaces
Int32

The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

Returns
Exceptions

Maximum runspaces is less than 1. Minimum runspaces is less than 1.

CreateRunspacePool(Int32, Int32, PSHost)

Creates a RunspacePool using the supplied host, minRunspaces and maxRunspaces

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Host.PSHost host);
Parameters
minRunspaces
Int32

The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

maxRunspaces
Int32

The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

host
PSHost

The explicit PSHost implementation.

Returns

A local runspacepool instance.

Exceptions

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo)

Creates a RunspacePool on the specified remote computer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo);
Parameters
minRunspaces
Int32

The minimum number of Runspace that should exist in this pool. Should be greater than 1.

maxRunspaces
Int32

The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

connectionInfo
RunspaceConnectionInfo

RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created

Returns
Exceptions

Maximum Pool size is less than 1. Minimum Pool size is less than 1.

connectionInfo is null

CreateRunspacePool(Int32, Int32, InitialSessionState, PSHost)

Creates a RunspacePool using the supplied initialSessionState, minRunspaces and maxRunspaces

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.InitialSessionState initialSessionState, System.Management.Automation.Host.PSHost host);
Parameters
minRunspaces
Int32

The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

maxRunspaces
Int32

The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

initialSessionState
InitialSessionState

initialSessionState to use when creating a new Runspace in the pool.

host
PSHost

The explicit PSHost implementation.

Returns
Exceptions

runspaceConfiguration is null. host is null.

Maximum runspaces is less than 1. Minimum runspaces is less than 1.

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo, PSHost)

Creates a RunspacePool on the specified remote runspace computer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo, System.Management.Automation.Host.PSHost host);
Parameters
minRunspaces
Int32

The minimum number of Runspace that should exist in this pool. Should be greater than 1.

maxRunspaces
Int32

The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

connectionInfo
RunspaceConnectionInfo

RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created

host
PSHost

Host associated with this runspace pool

Returns
Exceptions

Maximum Pool size is less than 1. Minimum Pool size is less than 1.

connectionInfo is null

CreateRunspacePool(Int32, Int32, RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)

Creates a RunspacePool on the specified remote runspace compuer. maxRunspaces limits the number of Runspaces that can exist in this pool. The minimum pool size is set to minPoolSoze.

public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo, System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.TypeTable typeTable, System.Management.Automation.PSPrimitiveDictionary applicationArguments);
Parameters
minRunspaces
Int32

The minimum number of Runspace that should exist in this pool. Should be greater than 1.

maxRunspaces
Int32

The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1.

connectionInfo
RunspaceConnectionInfo

RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created

host
PSHost

Host associated with this runspace pool

typeTable
TypeTable

The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer:

  1. SerializationMethod
  2. SerailizationDepth
  3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer:
  4. TargetTypeForDeserializaiton
  5. TypeConverter

    If typeTable is null no custom serialization/deserialization can be done. Default PowerShell behavior will be used in this case.

applicationArguments
PSPrimitiveDictionary

Application arguments the server can see in ApplicationArguments

Returns
Exceptions

Maximum Pool size is less than 1. Minimum Pool size is less than 1.

connectionInfo is null