ICommandRuntime Members

This interface is used when you are calling the Invoke to explicitly invoke a cmdlet from within another cmdlet. It provides a mechanism for overriding the behavior of the methods called by the cmdlet you are invoking, such as the ShouldProcess and WriteObject methods.

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

  Name Description
public property CurrentPSTransaction Gets the latest transaction started by running the Start-Transaction cmdlet. This property is introduced in Windows PowerShell 2.0.
public property Host Retrieves the host used by the cmdlet.

  Name Description
public method ShouldContinue Overloaded. Confirms the current operation with the user by displaying a query that is provided by the cmdlet and returning an answer based on the user feedback. The variants of this method can display the query with or without providing yes-to-all or no-to-all options to the user.
public method ShouldProcess Overloaded. Requests confirmation from the user before an action is taken. The variants of this method can be used to display the name of the resource to be changed, display the resource name and the action to be taken, and more.
public method ThrowTerminatingError Processes the error object passed when the cmdlet calls ThrowTerminatingError.
public method TransactionAvailable Determines if the Start-Transaction cmdlet has been called and that there is a Windows PowerShell transaction available that the cmdlet can participate in. This method is introduced in Windows PowerShell 2.0.
public method WriteCommandDetail Writes cmdlet execution information to the execution log of the pipeline.
public method WriteDebug Writes a debug message that can be displayed.
public method WriteError Processes a nonterminating error.
public method WriteObject Overloaded. Processes the objects written by the cmdlet to the output pipeline. The variants of this method can be used to process a single object or an object that can be enumerated.
public method WriteProgress Overloaded.  
public method WriteVerbose Processes a verbose message provided by the cmdlet.
public method WriteWarning Processes a warning message that is supplied by the cmdlet.