RunspaceFactory.CreateRunspace Method (RunspaceConfiguration)

Creates a single runspace that uses the default host and specified runspace configuration information.


Namespace: System.Management.Automation.Runspaces
Assembly: System.Management.Automation (in System.Management.Automation.dll)

'Usage
Dim runspaceConfiguration As RunspaceConfiguration
Dim returnValue As Runspace

returnValue = RunspaceFactory.CreateRunspace(runspaceConfiguration)

public static Runspace CreateRunspace (
	RunspaceConfiguration runspaceConfiguration
)
public static Runspace CreateRunspace (
	RunspaceConfiguration runspaceConfiguration
)
public static function CreateRunspace (
	runspaceConfiguration : RunspaceConfiguration
) : Runspace

Parameters

runspaceConfiguration

A RunspaceConfiguration object that represents the runspace configuration.

Return Value

Returns a Runspace object that represents the runspace. When the runspace is opened the specified runspace configuration is used.

A runspace is the operating environment used when invoking the commands of a pipeline. After the runspace is created, it must be opened by using one of the following methods before it can be used:

  • To open the runspace synchronously, call the Open method.

  • To open the runspace asynchronously, call the OpenAsync method.

Runspaces created with this method use the default host provided by Windows PowerShell. When using the default host there is no way to interact or communicate directly with the user through prompting.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms


Show:
© 2015 Microsoft