Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ConfirmAction C# (CSharp) Method

ConfirmAction() protected method

Guards execution of the given action using ShouldProcess and ShouldContinue. This is a legacy version forcompatibility with older RDFE cmdlets.
protected ConfirmAction ( bool force, string continueMessage, string processMessage, string target, System.Action action ) : void
force bool Do not ask for confirmation
continueMessage string Message to describe the action
processMessage string Message to prompt after the active is performed.
target string The target name.
action System.Action The action code
return void
        protected virtual void ConfirmAction(bool force, string continueMessage, string processMessage, string target,
            Action action)
        {
            if (_qosEvent != null)
            {
                _qosEvent.PauseQoSTimer();
            }

            if (force || ShouldContinue(continueMessage, ""))
            {
                if (ShouldProcess(target, processMessage))
                {
                    if (_qosEvent != null)
                    {
                        _qosEvent.ResumeQosTimer();
                    }
                    action();
                }
            }
        }

Same methods

AzurePSCmdlet::ConfirmAction ( bool force, string continueMessage, string processMessage, string target, System.Action action, Func useShouldContinue ) : void
AzurePSCmdlet::ConfirmAction ( string processMessage, string target, System.Action action ) : void