PowerShell.Runspace Property

Gets or sets the runspace that is used when the pipeline is invoked. The runspace is the operating environment that defines which commands, variables, and other elements are available. This property is introduced in Windows PowerShell 2.0.

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

Dim instance As PowerShell
Dim value As Runspace

value = instance.Runspace

instance.Runspace = value

[SuppressMessageAttribute("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="Runspace", Justification="Runspace is a well-known term in PowerShell.")] 
public Runspace Runspace { get; set; }
/** @property */
public Runspace get_Runspace ()

/** @property */
public void set_Runspace (Runspace value)

public function get Runspace () : Runspace

public function set Runspace (value : Runspace)

Property Value

A Runspace object that defines the runspace used when the pipeline is invoked. This property can be set to null, in which case a new runspace is created whenever the pipeline is invoked.

Exception typeCondition

The PowerShell object cannot be changed in its current state.


The PowerShell object is disposed.

This property and the RunspacePool property are mutually exclusive; setting one of them resets the other to null.

To invoke the pipeline synchronously, call the Invoke method. To invoke the pipeline asynchronously, call the BeginInvoke method.

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

© 2015 Microsoft