Windows Dev Center

Runspace Members

Represents the runspace that is the operating environment for command pipelines. This class provides methods for opening the runspace, creating single and nested pipelines for the runspace, and closing the runspace.

The following tables list the members exposed by the Runspace type.

  Name Description
public property ApartmentState Gets the apartment state of the thread used to run commands in the runspace. This property must be set before the runspace is opened.This property is introduced in Windows PowerShell 2.0.
public property static CanUseDefaultRunspace TBD. Introduced in Windows PowerShell 4.0.
public property ConnectionInfo Gets information about the connection used to open a runspace on a computer. Typically this is a connection to a remote computer; however it can also be a connection to the local computer. This property is introduced in Windows PowerShell 2.0.
public property Debugger Gets the debugger instance for the current runspace. This property is introduced in Windows PowerShell 2.0.
public property static DefaultRunspace Gets and sets the default runspace used to evaluate scripts.
public property DisconnectedOn TBD. Introduced in Windows PowerShell 4.0.
public property Events Gets the event manager who handles subscribing to and receiving events that are raised by Windows PowerShell. This property is introduced in Windows PowerShell 2.0.
public property ExpiresOn TBD. Introduced in Windows PowerShell 4.0.
public property Id TBDThis element is introduced in Windows PowerShell 5.0.
public property InitialSessionState Gets configuration information about the session state used when the runspace is opened. The configuration information includes the different types of commands, providers, and variables that are accessible to the runspace when the runspace is opened. This property is introduced in Windows PowerShell 2.0.
public property InstanceId Gets the unique identifier for this instance of the runspace. This identifier is typically used when logging individual instances of the runspace.
public property JobManager Gets the manager of the job source adapters registered in this runspace. Introduced in Windows PowerShell 3.0.
public property Name TBDThis element is introduced in Windows PowerShell 5.0.
public property OriginalConnectionInfo Gets the connection information that was originally supplied by the user. Introduced in Windows PowerShell 3.0.
public property RunspaceAvailability Gets a constant that identifies whether the runspace is available or busy. This property is introduced in Windows PowerShell 2.0.
public property RunspaceConfiguration Gets and sets the configuration information that describes the capabilities of the runspace.
public property RunspaceStateInfo Gets the current state of the runspace.
public property SessionStateProxy Gets access to methods that are used to get and set variables in the session state.
public property ThreadOptions Gets and sets information about how threads are created and used when a command is run within the runspace. This property must be set before the runspace is opened. This property is introduced in Windows PowerShell 2.0.
public property Version Gets the version of the assembly in which the runspace class is implemented.
Top

(see also Protected Methods)
 NameDescription
public methodClearBaseTransactionClears the base transaction that is used by all transactions that are performed on this runspace. This method is introduced in Windows PowerShell 2.0.
public methodCloseCloses the runspace and makes it unavailable for use.
public methodCloseAsyncCloses the runspace asynchronously, and makes it unavailable for use. This method returns control immediately, and then, in a separate thread, closes the runspace and stops all its associated pipelines.
public methodConnectSynchronously connects the remote runspace to the remote server and sets the runspace state to Opened. If the object is a local runspace, a not supported exception is thrown. Introduced in Windows PowerShell 3.0.
public methodConnectAsyncAsynchronously connects the remote runspace to the remote server and sets the runspace state to Opened. If the object is a local runspace, a not supported exception is thrown. Introduced in Windows PowerShell 3.0.
public methodCreateDisconnectedPipelineCreates a Pipeline object in the Disconnected state for the currently disconnected remote running command associated with this runspace. Introduced in Windows PowerShell 3.0.
public methodCreateDisconnectedPowerShellCreates a PowerShell object in the Disconnected state for the currently disconnected remote running command associated with this runspace. Introduced in Windows PowerShell 3.0.
public methodCreateNestedPipelineOverloaded. Creates a pipeline for the runspace while an existing pipeline is executing. The variants of this method can be used to create a nested pipeline by itself or to create a nested pipeline with a command string that contains commands, such as cmdlets and scripts, that can be executed by the pipeline.
public methodCreatePipelineOverloaded. Creates a pipeline for the runspace. The variants of this method can be used to create a pipeline by itself or to create a pipeline with a command string that contains commands, such as cmdlets and scripts, that can be executed by the pipeline.
public methodDisconnectSynchronously disconnects the remote runspace from the remote server and sets the runspace state to Disconnected. If the object is a local runspace, a not supported exception is thrown. Introduced in Windows PowerShell 3.0.
public methodDisconnectAsyncAsynchronously disconnects the remote runspace from the remote server and sets the runspace state to Disconnected. If the object is a local runspace, a not supported exception is thrown. Introduced in Windows PowerShell 3.0.
public methodDisposeOverloaded. Releases the resources used by the Runspace object. These methods implement the Dispose pattern used to release managed and unmanaged resources.
public methodEquals  (Inherited from Object)
public methodGetApplicationPrivateDataRetrieves private application data from the server that can be used by the runspace. This method is introduced in Windows PowerShell 2.0.
public methodGetCapabilitiesRetrieves the capabilities of this runspace.
public methodGetHashCode  (Inherited from Object)
public methodstaticGetRunspaceTBDThis element is introduced in Windows PowerShell 5.0.
public methodstaticGetRunspacesOverloaded. Queries the server for disconnected runspaces and creates an array of runspace objects associated with each disconnected runspace on the server. Introduced in Windows PowerShell 3.0.
public methodGetType  (Inherited from Object)
public methodOpenOpens the runspace synchronously, creating a Windows PowerShell execution environment.
public methodOpenAsyncOpens the runspace asynchronously, creating a Windows PowerShell execution environment. This method returns control immediately, and then, in a separate thread, opens the runspace.
public methodResetRunspaceStateResets the variable table for the runspace to the default state. Introduced in Windows PowerShell 3.0.
public methodSetBaseTransactionOverloaded. Sets the base transaction that is used by any transactions created on this runspace. The variants of this method can specify the base transaction with or without specifying the error the error condition that will cause the transaction to be automatically rolled back. This method is introduced in Windows PowerShell 2.0.
public methodToString  (Inherited from Object)
Top

(see also Extension Methods)
 NameDescription
protected methodDisposeOverloaded. Releases the resources used by the Runspace object. These methods implement the Dispose pattern used to release managed and unmanaged resources.
protected methodFinalize  (Inherited from Object)
protected methodMemberwiseClone  (Inherited from Object)
protected methodOnAvailabilityChangedRaises the AvailabilityChanged event when the state of the currently invoked pipeline changes. This method is introduced in Windows PowerShell 2.0.
protected methodUpdateRunspaceAvailabilityRaises the AvailabilityChanged event when the state of the currently invoked pipeline changes to the specified state. This method is introduced in Windows PowerShell 2.0.
Top

  Name Description
public extension method As  Use this method to adapt an object from a foreign app domain to a known interface in this app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method As  This is called to adapt an object from a foreign app domain to a known interface in this appDomainThis element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method As  Adapts an object from a foreign app domain to a known interface in this app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method Extend  Use this method to adapt and extend an object so that you can pass it to a foreign app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method Extend  This is called to adapt and extend an object that we wish to pass to a foreign app domainThis element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method Extend  Used to extend an object with an interface from a foreign app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method ToEnumerable  This element is introduced in Windows PowerShell 5.0. (Defined by CollectionExtensions.)
Top

  Name Description
public event AvailabilityChanged Occurs when the availability of the runspace changes, such as when the runspace becomes available and when it is busy. This event is introduced in Windows PowerShell 2.0.
public event StateChanged Occurs when the state of the runspace changes.
Top


Show:
© 2015 Microsoft