RunspaceFactory.CreateRunspace Method

Definition

Overloads

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

Creates a remote Runspace.

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)

Creates a remote Runspace.

CreateRunspace(PSHost, RunspaceConnectionInfo)

Creates a remote Runspace.

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)

Creates a remote Runspace.

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.

CreateRunspace(RunspaceConnectionInfo)

Creates a remote Runspace.

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

Creates a remote Runspace.

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

Parameters

connectionInfo
RunspaceConnectionInfo

It defines connection path to a remote runspace that needs to be created.

host
PSHost

The explicit PSHost implementation.

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:

  1. TargetTypeForDeserialization
  2. TypeConverter
applicationArguments
PSPrimitiveDictionary

Application arguments the server can see in ApplicationArguments

name
String

Name for remote runspace.

Returns

A remote Runspace.

Applies to

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)

Creates a remote Runspace.

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

It defines connection path to a remote runspace that needs to be created.

host
PSHost

The explicit PSHost implementation.

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:

  1. TargetTypeForDeserialization
  2. TypeConverter
applicationArguments
PSPrimitiveDictionary

Application arguments the server can see in ApplicationArguments

Returns

A remote Runspace.

Applies to

CreateRunspace(PSHost, RunspaceConnectionInfo)

Creates a remote Runspace.

public:
 static System::Management::Automation::Runspaces::Runspace ^ CreateRunspace(System::Management::Automation::Host::PSHost ^ host, System::Management::Automation::Runspaces::RunspaceConnectionInfo ^ connectionInfo);

Parameters

host
PSHost

The explicit PSHost implementation.

connectionInfo
RunspaceConnectionInfo

It defines connection path to a remote runspace that needs to be created.

Returns

A remote 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);

Parameters

host
PSHost

Host implementation for runspace.

runspaceConfiguration
RunspaceConfiguration

RunspaceConfiguration information for the runspace.

Returns

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

Parameters

host
PSHost

Host implementation for runspace.

initialSessionState
InitialSessionState

InitialSessionState information for the runspace.

Returns

A runspace object

Exceptions

Thrown when initialSessionState is null

Applies to

CreateRunspace(RunspaceConnectionInfo, PSHost, TypeTable)

Creates a remote Runspace.

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

It defines connection path to a remote runspace that needs to be created.

host
PSHost

The explicit PSHost implementation.

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:

  1. TargetTypeForDeserialization
  2. TypeConverter

Returns

A remote 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);

Parameters

runspaceConfiguration
RunspaceConfiguration

RunspaceConfiguration information for the runspace.

Returns

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

Parameters

initialSessionState
InitialSessionState

InitialSessionState information for the runspace.

Returns

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

Parameters

host
PSHost

The explicit PSHost implementation.

Returns

A runspace object

Exceptions

Thrown when host is null.

Applies to

CreateRunspace()

Creates a runspace using host of type Microsoft.PowerShell.DefaultHost.

public:
 static System::Management::Automation::Runspaces::Runspace ^ CreateRunspace();

Returns

A runspace object.

Applies to

CreateRunspace(RunspaceConnectionInfo)

Creates a remote Runspace.

public:
 static System::Management::Automation::Runspaces::Runspace ^ CreateRunspace(System::Management::Automation::Runspaces::RunspaceConnectionInfo ^ connectionInfo);

Parameters

connectionInfo
RunspaceConnectionInfo

It defines connection path to a remote runspace that needs to be created.

Returns

A remote Runspace.

Applies to