public override void ExecuteCmdlet() { if (string.IsNullOrEmpty(ResourceGroupName) && string.IsNullOrEmpty(Name)) { ResourceGroupName = ResourceIdUtility.GetResourceGroupName(Id); Name = ResourceIdUtility.GetResourceName(Id); } ConfirmAction( ProjectResources.CancelResourceGroupDeploymentMessage, ResourceGroupName, () => ResourceManagerSdkClient.CancelDeployment(ResourceGroupName, Name)); WriteObject(true); }
public override void ExecuteCmdlet() { var options = new FilterDeploymentOptions(DeploymentScopeType.ResourceGroup) { ResourceGroupName = !string.IsNullOrEmpty(this.ResourceGroupName) ? this.ResourceGroupName : ResourceIdUtility.GetResourceGroupName(Id), DeploymentName = !string.IsNullOrEmpty(this.Name) ? this.Name : ResourceIdUtility.GetResourceName(Id) }; ConfirmAction( ProjectResources.CancelDeploymentMessage, ResourceGroupName, () => ResourceManagerSdkClient.CancelDeployment(options)); WriteObject(true); }
public override void ExecuteCmdlet() { var options = new FilterDeploymentOptions(DeploymentScopeType.Subscription) { DeploymentName = !string.IsNullOrEmpty(this.Name) ? this.Name : !string.IsNullOrEmpty(this.Id) ? ResourceIdUtility.GetResourceName(this.Id) : this.InputObject.DeploymentName }; ConfirmAction( ProjectResources.CancelDeploymentMessage, this.Name, () => ResourceManagerSdkClient.CancelDeployment(options)); if (this.PassThru.IsPresent) { WriteObject(true); } }
protected override void OnProcessRecord() { var options = new FilterDeploymentOptions(DeploymentScopeType.Tenant) { DeploymentName = !string.IsNullOrEmpty(this.Name) ? this.Name : !string.IsNullOrEmpty(this.Id) ? ResourceIdUtility.GetDeploymentName(this.Id) : this.InputObject.DeploymentName }; ConfirmAction( ProjectResources.CancelDeploymentMessage, this.Name, () => ResourceManagerSdkClient.CancelDeployment(options)); if (this.PassThru.IsPresent) { WriteObject(true); } }