Cmdlet.Stopping Property

Definition

Is this command stopping?

public bool Stopping { get; }
Property Value

Remarks

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

        In general, if a Cmdlet's override implementation of ProcessRecord etc.
        throws <xref href="System.Management.Automation.PipelineStoppedException"></xref>, the best thing to do is to
        shut down the operation and return to the caller.
        It is acceptable to not catch <xref href="System.Management.Automation.PipelineStoppedException"></xref>
        and allow the exception to reach ProcessRecord.