共用方式為


ICommandRuntime2 Interface

Definition

This interface defines the set of functionality that must be implemented to directly execute an instance of a Cmdlet. ICommandRuntime2 extends the ICommandRuntime interface by adding support for the informational data stream.

public interface class ICommandRuntime2 : System::Management::Automation::ICommandRuntime
public interface ICommandRuntime2 : System.Management.Automation.ICommandRuntime
type ICommandRuntime2 = interface
    interface ICommandRuntime
Public Interface ICommandRuntime2
Implements ICommandRuntime
Implements

Properties

CurrentPSTransaction

Gets an object that surfaces the current PowerShell transaction. When this object is disposed, PowerShell resets the active transaction.

(Inherited from ICommandRuntime)
Host

Returns an instance of the PSHost implementation for this environment.

(Inherited from ICommandRuntime)

Methods

ShouldContinue(String, String, Boolean, Boolean, Boolean)

Confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant offers Yes, No, YesToAll and NoToAll.

ShouldContinue(String, String, Boolean, Boolean)

Called to confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant offers Yes, No, YesToAll and NoToAll.

(Inherited from ICommandRuntime)
ShouldContinue(String, String)

Called by a cmdlet to confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant only offers Yes/No, not YesToAll/NoToAll.

(Inherited from ICommandRuntime)
ShouldProcess(String, String, String, ShouldProcessReason)

Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed.

This variant allows the caller to specify the complete text describing the operation, rather than just the name and action.

(Inherited from ICommandRuntime)
ShouldProcess(String, String, String)

Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed.

This variant allows the caller to specify the complete text describing the operation, rather than just the name and action.

(Inherited from ICommandRuntime)
ShouldProcess(String, String)

Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed.

This variant allows the caller to specify text for both the target resource and the action.

(Inherited from ICommandRuntime)
ShouldProcess(String)

Called by the cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed.

(Inherited from ICommandRuntime)
ThrowTerminatingError(ErrorRecord)

This interface will be called to route fatal errors from a cmdlet.

(Inherited from ICommandRuntime)
TransactionAvailable()

Returns true if a transaction is available and active.

(Inherited from ICommandRuntime)
WriteCommandDetail(String)

Write text into pipeline execution log.

(Inherited from ICommandRuntime)
WriteDebug(String)

Display debug information.

(Inherited from ICommandRuntime)
WriteError(ErrorRecord)

Internal variant: Writes the specified error to the error pipe.

(Inherited from ICommandRuntime)
WriteInformation(InformationRecord)

Write an informational record to the command runtime.

WriteObject(Object, Boolean)

Called to write one or more objects to the output pipe. If the object is a collection and the enumerateCollection flag is true, the objects in the collection will be written individually.

(Inherited from ICommandRuntime)
WriteObject(Object)

Called to write objects to the output pipe.

(Inherited from ICommandRuntime)
WriteProgress(Int64, ProgressRecord)

Displays progress output if enabled.

(Inherited from ICommandRuntime)
WriteProgress(ProgressRecord)

Called by the cmdlet to display progress information.

(Inherited from ICommandRuntime)
WriteVerbose(String)

Called when the cmdlet want to display verbose information.

(Inherited from ICommandRuntime)
WriteWarning(String)

Called by the cmdlet to display warning information.

(Inherited from ICommandRuntime)

Applies to