Cmdlet.Stopping Cmdlet.Stopping Cmdlet.Stopping Property


Is this command stopping?

public bool Stopping { get; }
member this.Stopping : bool
Public ReadOnly Property Stopping As Boolean
Property Value


If Stopping is true, many Cmdlet methods will throw PipelineStoppedException.

In general, if a Cmdlet's override implementation of ProcessRecord etc. throws PipelineStoppedException, the best thing to do is to shut down the operation and return to the caller. It is acceptable to not catch PipelineStoppedException and allow the exception to reach ProcessRecord.

Applies to