public override void ExecuteCmdlet() { ExecutionBlock(() => { if (this.IsParameterBound(c => c.InputObject)) { ObjectId = InputObject.Id; } else if (this.IsParameterBound(c => c.DisplayName)) { var group = ActiveDirectoryClient.GetGroupByDisplayName(DisplayName); ObjectId = group.Id; } ConfirmAction( Force.IsPresent, string.Format(ProjectResources.RemoveGroupConfirmation, ObjectId), ProjectResources.RemovingGroup, ObjectId.ToString(), () => ActiveDirectoryClient.RemoveGroup(ObjectId.ToString())); if (PassThru.IsPresent) { WriteObject(true); } }); }