public override void ExecuteCmdlet() { ConfirmAction( Force.IsPresent, string.Format(Resources.RemoveJobWarning, JobName), Resources.RemoveJobMessage, JobName, () => { WriteObject(SMClient.DeleteJob(region: Location, jobCollection: JobCollectionName, jobName: JobName), true); }); }
public override void ExecuteCmdlet() { ConfirmAction( Force.IsPresent, string.Format(Resources.RemoveJobWarning, JobName), Resources.RemoveJobMessage, JobName, () => { if (!string.IsNullOrEmpty(Location) && !SMClient.GetAvailableRegions().Contains(Location, StringComparer.OrdinalIgnoreCase)) { throw new Exception(Resources.SchedulerInvalidLocation); } else { WriteObject(SMClient.DeleteJob(region: Location, jobCollection: JobCollectionName, jobName: JobName), true); } }); }