다음을 통해 공유


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

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

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

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

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

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

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

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

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

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

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

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

Returns

A remote Runspace.

Applies to