Compartilhar via


RunspaceFactory.CreateRunspacePool Method

Definition

Overloads

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

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()

Creates a RunspacePool 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 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 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)

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, System::Management::Automation::Runspaces::TypeTable ^ typeTable);
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);
static member CreateRunspacePool : int * int * System.Management.Automation.Runspaces.RunspaceConnectionInfo * System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.TypeTable -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (minRunspaces As Integer, maxRunspaces As Integer, connectionInfo As RunspaceConnectionInfo, host As PSHost, typeTable As TypeTable) As RunspacePool

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. SerializationDepth
  3. SpecificSerializationProperties TypeTable has the following information used by deserializer:
  4. TargetTypeForDeserialization
  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

Applies to

CreateRunspacePool()

Creates a RunspacePool with MaxRunspaces 1 and MinRunspaces 1.

public:
 static System::Management::Automation::Runspaces::RunspacePool ^ CreateRunspacePool();
public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool ();
static member CreateRunspacePool : unit -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool () As RunspacePool

Returns

Applies to

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);
public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (System.Management.Automation.Runspaces.InitialSessionState initialSessionState);
static member CreateRunspacePool : System.Management.Automation.Runspaces.InitialSessionState -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (initialSessionState As InitialSessionState) As RunspacePool

Parameters

initialSessionState
InitialSessionState

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

Returns

Exceptions

InitialSessionState is null.

Applies to

CreateRunspacePool(Int32, Int32)

Creates a RunspacePool 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);
public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces);
static member CreateRunspacePool : int * int -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (minRunspaces As Integer, maxRunspaces As Integer) As RunspacePool

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.

Applies to

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);
public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Host.PSHost host);
static member CreateRunspacePool : int * int * System.Management.Automation.Host.PSHost -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (minRunspaces As Integer, maxRunspaces As Integer, host As PSHost) As RunspacePool

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

host is null.

Applies to

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);
public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo);
static member CreateRunspacePool : int * int * System.Management.Automation.Runspaces.RunspaceConnectionInfo -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (minRunspaces As Integer, maxRunspaces As Integer, connectionInfo As RunspaceConnectionInfo) As RunspacePool

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

Applies to

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);
public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.InitialSessionState initialSessionState, System.Management.Automation.Host.PSHost host);
static member CreateRunspacePool : int * int * System.Management.Automation.Runspaces.InitialSessionState * System.Management.Automation.Host.PSHost -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (minRunspaces As Integer, maxRunspaces As Integer, initialSessionState As InitialSessionState, host As PSHost) As RunspacePool

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

initialSessionState is null. host is null.

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

Applies to

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);
public static System.Management.Automation.Runspaces.RunspacePool CreateRunspacePool (int minRunspaces, int maxRunspaces, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo, System.Management.Automation.Host.PSHost host);
static member CreateRunspacePool : int * int * System.Management.Automation.Runspaces.RunspaceConnectionInfo * System.Management.Automation.Host.PSHost -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (minRunspaces As Integer, maxRunspaces As Integer, connectionInfo As RunspaceConnectionInfo, host As PSHost) As RunspacePool

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

Applies to

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

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, System::Management::Automation::Runspaces::TypeTable ^ typeTable, System::Management::Automation::PSPrimitiveDictionary ^ applicationArguments);
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);
static member CreateRunspacePool : int * int * System.Management.Automation.Runspaces.RunspaceConnectionInfo * System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.TypeTable * System.Management.Automation.PSPrimitiveDictionary -> System.Management.Automation.Runspaces.RunspacePool
Public Shared Function CreateRunspacePool (minRunspaces As Integer, maxRunspaces As Integer, connectionInfo As RunspaceConnectionInfo, host As PSHost, typeTable As TypeTable, applicationArguments As PSPrimitiveDictionary) As RunspacePool

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. SerializationDepth
  3. SpecificSerializationProperties TypeTable has the following information used by deserializer:
  4. TargetTypeForDeserialization
  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

Applies to