RunspaceFactory.CreateRunspace Method

Definition

Overloads

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary, String)
CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)
CreateRunspace(PSHost, RunspaceConnectionInfo)
CreateRunspace(PSHost, RunspaceConfiguration)

Creates a runspace using specified PSHost and RunspaceConfiguration

CreateRunspace(PSHost, InitialSessionState)

Creates a runspace using specified PSHost and InitialSessionState

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable)
CreateRunspace(RunspaceConfiguration)

Creates a runspace using Microsoft.PowerShell.DefaultHost

CreateRunspace(InitialSessionState)

Creates a runspace using Microsoft.PowerShell.DefaultHost

CreateRunspace(PSHost)

Creates a runspace using specified host. This runspace is created using the configuration information from EntryAssembly.

CreateRunspace()

Creates a runspace using host of type Microsoft.PowerShell.DefaultHost. This runspace is created using the RunspaceConfiguration information from EntryAssembly.

CreateRunspace(RunspaceConnectionInfo)

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary, String)

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo, System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.TypeTable typeTable, System.Management.Automation.PSPrimitiveDictionary applicationArguments, string name);
Parameters
connectionInfo
RunspaceConnectionInfo
host
PSHost
typeTable
TypeTable
applicationArguments
PSPrimitiveDictionary
name
String
Returns

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo, System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.TypeTable typeTable, System.Management.Automation.PSPrimitiveDictionary applicationArguments);
Parameters
connectionInfo
RunspaceConnectionInfo
host
PSHost
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
applicationArguments
PSPrimitiveDictionary

Application arguments the server can see in ApplicationArguments

Returns

CreateRunspace(PSHost, RunspaceConnectionInfo)

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo);
Parameters
host
PSHost
connectionInfo
RunspaceConnectionInfo
Returns

CreateRunspace(PSHost, RunspaceConfiguration)

Creates a runspace using specified PSHost and RunspaceConfiguration

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.RunspaceConfiguration runspaceConfiguration);
Parameters
host
PSHost

Host implementation for runspace.

runspaceConfiguration
RunspaceConfiguration

RunspaceConfiguration information for the runspace.

Returns

A runspace object

Exceptions

Thrown when runspaceConfiguration is null

CreateRunspace(PSHost, InitialSessionState)

Creates a runspace using specified PSHost and InitialSessionState

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.InitialSessionState initialSessionState);
Parameters
host
PSHost

Host implementation for runspace.

initialSessionState
InitialSessionState

InitialSessionState information for the runspace.

Returns

A runspace object

Exceptions

Thrown when initialSessionState is null

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable)

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo, System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.TypeTable typeTable);
Parameters
connectionInfo
RunspaceConnectionInfo
host
PSHost
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
Returns

CreateRunspace(RunspaceConfiguration)

Creates a runspace using Microsoft.PowerShell.DefaultHost

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.RunspaceConfiguration runspaceConfiguration);
Parameters
runspaceConfiguration
RunspaceConfiguration

RunspaceConfiguration information for the runspace.

Returns

A runspace object

Exceptions

Thrown when runspaceConfiguration is null

CreateRunspace(InitialSessionState)

Creates a runspace using Microsoft.PowerShell.DefaultHost

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.InitialSessionState initialSessionState);
Parameters
initialSessionState
InitialSessionState

InitialSessionState information for the runspace.

Returns

A runspace object

Exceptions

Thrown when initialSessionState is null

CreateRunspace(PSHost)

Creates a runspace using specified host. This runspace is created using the configuration information from EntryAssembly.

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host);
Parameters
host
PSHost

The explicit PSHost implementation.

Returns

A runspace object

Exceptions

Thrown when host is null.

CreateRunspace()

Creates a runspace using host of type Microsoft.PowerShell.DefaultHost. This runspace is created using the RunspaceConfiguration information from EntryAssembly.

public static System.Management.Automation.Runspaces.Runspace CreateRunspace ();
Returns

A runspace object.

CreateRunspace(RunspaceConnectionInfo)

public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo);
Parameters
connectionInfo
RunspaceConnectionInfo
Returns