protected override void OnProcessRecord() { ConfirmAction( ProjectResources.DeleteDeploymentMessage, Name, () => { var options = new FilterDeploymentOptions(DeploymentScopeType.ManagementGroup) { ManagementGroupId = !string.IsNullOrEmpty(this.ManagementGroupId) ? this.ManagementGroupId : !string.IsNullOrEmpty(this.Id) ? ResourceIdUtility.GetManagementGroupId(this.Id) : this.InputObject.ManagementGroupId, DeploymentName = !string.IsNullOrEmpty(this.Name) ? this.Name : !string.IsNullOrEmpty(this.Id) ? ResourceIdUtility.GetDeploymentName(this.Id) : this.InputObject.DeploymentName }; this.ResourceManagerSdkClient.DeleteDeploymentAtManagementGroup(options.ManagementGroupId, options.DeploymentName); if (this.PassThru.IsPresent) { WriteObject(true); } }); }
protected override void OnProcessRecord() { FilterDeploymentOptions options = new FilterDeploymentOptions(DeploymentScopeType.ManagementGroup) { ManagementGroupId = this.ManagementGroupId ?? ResourceIdUtility.GetManagementGroupId(this.Id), DeploymentName = this.Name ?? (string.IsNullOrEmpty(this.Id) ? null : ResourceIdUtility.GetDeploymentName(this.Id)) }; WriteObject(ResourceManagerSdkClient.FilterDeployments(options), true); }
public override void ExecuteCmdlet() { var options = new FilterDeploymentOptions(DeploymentScopeType.ManagementGroup) { ManagementGroupId = !string.IsNullOrEmpty(this.ManagementGroupId) ? this.ManagementGroupId : !string.IsNullOrEmpty(this.Id) ? ResourceIdUtility.GetManagementGroupId(this.Id) : this.InputObject.ManagementGroupId, 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); } }