public override void ExecuteCmdlet() { PolicyName = (this.ParameterSetName == PolicyNameParameterSet) ? Name : Policy.Name; if (string.IsNullOrEmpty(PolicyName)) { throw new ArgumentException(Resources.PolicyNameIsEmptyOrNull); } ExecutionBlock(() => { ConfirmAction( Force.IsPresent, string.Format(Resources.RemoveProtectionPolicyWarning, PolicyName), Resources.RemoveProtectionPolicyMessage, PolicyName, () => { base.ExecuteCmdlet(); WriteDebug(Resources.MakingClientCall); ServiceClientAdapter.RemoveProtectionPolicy(PolicyName); WriteDebug(Resources.ProtectionPolicyDeleted); } ); if (PassThru.IsPresent) { WriteObject(Policy); } }, ShouldProcess(PolicyName, VerbsCommon.Remove)); }