PowerShell Members

Provides methods that are used to create a pipeline of commands and invoke those commands either synchronously or asynchronously within a runspace. This class also provides access to the output streams that contain data that is generated when the commands are invoked. This class is primarily intended for host applications that programmatically use Windows PowerShell to perform tasks. This class is introduced in Windows PowerShell 2.0.

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

  Name Description
public property Commands Gets or sets the commands of the pipeline invoked by the PowerShell object. This property is introduced in Windows PowerShell 2.0.
public property HadErrors Gets a value that indicates whether an error occurred while executing the pipeline.
public property HistoryString Gets or sets the history string to be used for displaying the history.
public property InstanceId Gets the global identifier for this instance of the PowerShell object. This identifier is primarily used for logging purposes. This property is introduced in Windows PowerShell 2.0.
public property InvocationStateInfo Gets information about the current state of the invocation of the pipeline, such as whether it is running, completed, or failed. This property is introduced in Windows PowerShell 2.0.
public property IsNested Gets a value that indicates whether the current PowerShell object is nested within a parent PowerShell object. This property is introduced in Windows PowerShell 2.0.
public property IsRunspaceOwner  
public property Runspace 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.
public property RunspacePool Gets or sets the runspace pool used by the PowerShell object. A runspace from this pool is used whenever the PowerShell object pipeline is invoked. This property is introduced in Windows PowerShell 2.0.
public property Streams Gets the data streams that contain any messages and error reports that were generated when the pipeline of the PowerShell object is invoked.
Top

(see also Protected Methods)
 NameDescription
public methodAddArgumentAdds an argument for a positional parameter of a command without specifying the parameter name. This method is introduced in Windows PowerShell 2.0.
public methodAddCommandOverloaded. Adds a cmdlet to the end of the pipeline of the PowerShell object. The variants of this method can add the command with or without specifying that the command should be run within a new local scope. This method is introduced in Windows PowerShell 2.0.
public methodAddParameterOverloaded. Adds a parameter to the last command of the pipeline. This method is introduced in Windows PowerShell 2.0.
public methodAddParametersOverloaded. Adds parameters to the last command of the pipeline. The variants of this method can specify the parameters as a dictionary or as a list. This method is introduced in Windows PowerShell 2.0.
public methodAddScriptOverloaded. Adds a script to the end of the pipeline of the PowerShell object. This method is introduced in Windows PowerShell 2.0.
public methodAddStatementAdds an additional statement to the end of the pipeline of the PowerShell object.
public methodAsJobProxyRetrieves a Windows PowerShell job proxy, which can be used to control the invocation of the command with the -AsJob parameter (to run a cmdlet in the background).
public methodBeginInvokeOverloaded. Asynchronously starts running the commands of the PowerShell object pipeline. This method is introduced in Windows PowerShell 2.0.
public methodBeginStopAsynchronously stops the currently running execution of the pipeline.
public methodConnectConnects synchronously to a running command on a remote server.
public methodConnectAsyncOverloaded.  
public methodstaticCreateOverloaded. Initializes a new instance of the PowerShell class.
public methodCreateNestedPowerShellCreates a nested PowerShell object within the current object.
public methodDisposeReleases all resources used by the PowerShell object. This method is introduced in Windows PowerShell 2.0.
public methodEndInvokeWaits for the pending asynchronous BeginInvoke call to be completed and then returns the results of the call. This method is introduced in Windows PowerShell 2.0.
public methodEndStopWaits for the pending asynchronous BeginStop call to be completed. This method is introduced in Windows PowerShell 2.0.
public methodEquals  (Inherited from Object)
public methodGetHashCode  (Inherited from Object)
public methodGetType  (Inherited from Object)
public methodInvokeOverloaded. Synchronously runs the commands of the PowerShell object pipeline. The variants of this method can invoke the pipeline with or without using input data for the first command, with or without using invocation settings that specify how Windows PowerShell handles the invocation, and with or without specifying an output buffer. This method is introduced in Windows PowerShell 2.0.
public methodStopSynchronously stops the currently running execution of the pipeline. This method is introduced in Windows PowerShell 2.0.
public methodToString  (Inherited from Object)
Top

  Name Description
protected method Finalize  (Inherited from Object)
protected method MemberwiseClone  (Inherited from Object)
Top

  Name Description
public event InvocationStateChanged Occurs when the state of the pipeline of the PowerShell object changes. This event is introduced in Windows PowerShell 2.0.
Top


Show:
© 2014 Microsoft