RunspaceFactory.CreateRunspace Method

Creates a single runspace. The variants of this method can be used to create a runspace that uses a custom host or the default host, plus other data such as initial session state settings, configuration information, connection information (for remoting), and type tables.

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.

NameDescription
RunspaceFactory.CreateRunspace ()Creates a single runspace that uses the default host and runspace configuration.
RunspaceFactory.CreateRunspace (PSHost)Creates a single runspace that uses a custom host.
RunspaceFactory.CreateRunspace (PSHost, InitialSessionState)Creates a single runspace that uses a custom host and initial session state information.
RunspaceFactory.CreateRunspace (PSHost, RunspaceConfiguration)Creates a single runspace that uses a custom host and runspace configuration information.
RunspaceFactory.CreateRunspace (PSHost, RunspaceConnectionInfo)Creates a single runspace that can be opened on a remote computer. The runspace uses a custom host and connection information.
RunspaceFactory.CreateRunspace (InitialSessionState)Creates a single runspace that uses the default host and specified initial session state information.
RunspaceFactory.CreateRunspace (RunspaceConfiguration)Creates a single runspace that uses the default host and specified runspace configuration information.
RunspaceFactory.CreateRunspace (RunspaceConnectionInfo)Creates a single runspace that can be opened on a remote computer. The runspace uses the default host and specified connection information.
RunspaceFactory.CreateRunspace (RunspaceConnectionInfo, PSHost, TypeTable)Creates a single runspace that can be opened on a remote computer. The runspace uses a custom host, connection information, and type table (serialization) information. This method is introduced in Windows PowerShell 2.0.
RunspaceFactory.CreateRunspace (RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary)Creates a single runspace that can be opened on a remote computer. The runspace uses a custom host, connection information, type table (serialization) information, and endpoint application arguments. This method is introduced in Windows PowerShell 2.0.
RunspaceFactory.CreateRunspace (RunspaceConnectionInfo, PSHost, TypeTable, PSPrimitiveDictionary, String) 

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft