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, System::String ^ name);
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);
static member CreateRunspace : System.Management.Automation.Runspaces.RunspaceConnectionInfo * System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.TypeTable * System.Management.Automation.PSPrimitiveDictionary * string -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (connectionInfo As RunspaceConnectionInfo, host As PSHost, typeTable As TypeTable, applicationArguments As PSPrimitiveDictionary, name As String) As Runspace

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

name
String

Name for remote runspace.

Returns

Runspace

Applies to

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);
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);
static member CreateRunspace : System.Management.Automation.Runspaces.RunspaceConnectionInfo * System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.TypeTable * System.Management.Automation.PSPrimitiveDictionary -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (connectionInfo As RunspaceConnectionInfo, host As PSHost, typeTable As TypeTable, applicationArguments As PSPrimitiveDictionary) As Runspace

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

Runspace

Applies to

CreateRunspace(PSHost, RunspaceConnectionInfo)

public:
 static System::Management::Automation::Runspaces::Runspace ^ CreateRunspace(System::Management::Automation::Host::PSHost ^ host, System::Management::Automation::Runspaces::RunspaceConnectionInfo ^ connectionInfo);
public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo);
static member CreateRunspace : System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.RunspaceConnectionInfo -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (host As PSHost, connectionInfo As RunspaceConnectionInfo) As Runspace

Parameters

host
PSHost
connectionInfo
RunspaceConnectionInfo

Returns

Runspace

Applies to

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);
public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.RunspaceConfiguration runspaceConfiguration);
static member CreateRunspace : System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.RunspaceConfiguration -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (host As PSHost, runspaceConfiguration As RunspaceConfiguration) As Runspace

Parameters

host
PSHost

Host implementation for runspace.

runspaceConfiguration
RunspaceConfiguration

RunspaceConfiguration information for the runspace.

Returns

Runspace

A runspace object

Exceptions

Thrown when runspaceConfiguration is null

Applies to

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);
public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host, System.Management.Automation.Runspaces.InitialSessionState initialSessionState);
static member CreateRunspace : System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.InitialSessionState -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (host As PSHost, initialSessionState As InitialSessionState) As Runspace

Parameters

host
PSHost

Host implementation for runspace.

initialSessionState
InitialSessionState

InitialSessionState information for the runspace.

Returns

Runspace

A runspace object

Exceptions

Thrown when initialSessionState is null

Applies to

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);
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);
static member CreateRunspace : System.Management.Automation.Runspaces.RunspaceConnectionInfo * System.Management.Automation.Host.PSHost * System.Management.Automation.Runspaces.TypeTable -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (connectionInfo As RunspaceConnectionInfo, host As PSHost, typeTable As TypeTable) As Runspace

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

Runspace

Applies to

CreateRunspace(RunspaceConfiguration)

Creates a runspace using Microsoft.PowerShell.DefaultHost

public:
 static System::Management::Automation::Runspaces::Runspace ^ CreateRunspace(System::Management::Automation::Runspaces::RunspaceConfiguration ^ runspaceConfiguration);
public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.RunspaceConfiguration runspaceConfiguration);
static member CreateRunspace : System.Management.Automation.Runspaces.RunspaceConfiguration -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (runspaceConfiguration As RunspaceConfiguration) As Runspace

Parameters

runspaceConfiguration
RunspaceConfiguration

RunspaceConfiguration information for the runspace.

Returns

Runspace

A runspace object

Exceptions

Thrown when runspaceConfiguration is null

Applies to

CreateRunspace(InitialSessionState)

Creates a runspace using Microsoft.PowerShell.DefaultHost

public:
 static System::Management::Automation::Runspaces::Runspace ^ CreateRunspace(System::Management::Automation::Runspaces::InitialSessionState ^ initialSessionState);
public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.InitialSessionState initialSessionState);
static member CreateRunspace : System.Management.Automation.Runspaces.InitialSessionState -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (initialSessionState As InitialSessionState) As Runspace

Parameters

initialSessionState
InitialSessionState

InitialSessionState information for the runspace.

Returns

Runspace

A runspace object

Exceptions

Thrown when initialSessionState is null

Applies to

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);
public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Host.PSHost host);
static member CreateRunspace : System.Management.Automation.Host.PSHost -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (host As PSHost) As Runspace

Parameters

host
PSHost

The explicit PSHost implementation.

Returns

Runspace

A runspace object

Exceptions

Thrown when host is null.

Applies to

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();
public static System.Management.Automation.Runspaces.Runspace CreateRunspace ();
static member CreateRunspace : unit -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace () As Runspace

Returns

Runspace

A runspace object.

Applies to

CreateRunspace(RunspaceConnectionInfo)

public:
 static System::Management::Automation::Runspaces::Runspace ^ CreateRunspace(System::Management::Automation::Runspaces::RunspaceConnectionInfo ^ connectionInfo);
public static System.Management.Automation.Runspaces.Runspace CreateRunspace (System.Management.Automation.Runspaces.RunspaceConnectionInfo connectionInfo);
static member CreateRunspace : System.Management.Automation.Runspaces.RunspaceConnectionInfo -> System.Management.Automation.Runspaces.Runspace
Public Shared Function CreateRunspace (connectionInfo As RunspaceConnectionInfo) As Runspace

Parameters

connectionInfo
RunspaceConnectionInfo

Returns

Runspace

Applies to