Cmdlet.WriteProgress Method

Writes a progress record to the host.


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

'Usage
Dim instance As Cmdlet
Dim progressRecord As ProgressRecord

instance.WriteProgress(progressRecord)

public void WriteProgress (
	ProgressRecord progressRecord
)
public void WriteProgress (
	ProgressRecord progressRecord
)
public function WriteProgress (
	progressRecord : ProgressRecord
)

Parameters

progressRecord

A ProgressRecord object that describes the progress of the operation being performed by the cmdlet.

Exception typeCondition
PipelineStoppedException

The pipeline is stopped. The pipeline was terminated either before the call was made or while the call was in progress. By default, the cmdlet should allow the caller of the processing record method to catch this exception.

InvalidOperationException

The call cannot be completed at this time or cannot be completed from this thread. For more information, see the following Remarks section.

This method is called to display the progress of a cmdlet when it is performing an operation that takes a long time.

This method can be called only from within the cmdlet implementation of the BeginProcessing, ProcessRecord, and EndProcessing methods and only from that thread. If the call is made outside one of these implementations or from another thread, an InvalidOperationException exception is thrown.

By default, progress information is displayed. However, this behavior can be changed by configuring the ProgressPreference shell variable.

For more information about cmdlets, see Windows PowerShell Cmdlets.


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

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft