Dela via


Cmdlet.WriteProgress(ProgressRecord) Method

Definition

Display progress information.

public:
 void WriteProgress(System::Management::Automation::ProgressRecord ^ progressRecord);
public void WriteProgress (System.Management.Automation.ProgressRecord progressRecord);
member this.WriteProgress : System.Management.Automation.ProgressRecord -> unit
Public Sub WriteProgress (progressRecord As ProgressRecord)

Parameters

progressRecord
ProgressRecord

Progress information.

Exceptions

The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc.

Not permitted at this time or from this thread. WriteProgress may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread.

Remarks

Use WriteProgress to display progress information about the activity of your Cmdlet, when the operation of your Cmdlet could potentially take a long time.

By default, progress output will be displayed, although this can be configured with the ProgressPreference shell variable.

Applies to

See also