예제 #1
0
        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);
                }
            });
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
            }
        }