/// <summary> /// Updates the work item. /// </summary> /// <param name="cmdlet">The cmdlet.</param> /// <param name="original">The original work item.</param> /// <param name="updated">The updated updated work item.</param> /// <returns>A WorkItem.</returns> public static WorkItem UpdateWorkItem(this PSCmdlet cmdlet, WorkItem original, WorkItem updated) { Guard.Requires <InvalidOperationException>( original.Id == updated.Id, "Original Work Item Id and Updated Work Item Id do not match."); var cmdletParams = cmdlet.CreateParamDictionary().AddParam("Id", original.Id) .AddParam("UpdatedWorkItem", updated).AddParam("OriginalWorkItem", original); return(cmdlet.InvokeModuleCmdlet <WorkItem>("Update-WorkItem", cmdletParams).First()); }
/// <summary> /// Gets the work item. /// </summary> /// <param name="cmdlet">The cmdlet.</param> /// <param name="id">The identifier.</param> /// <returns>A WorkItem.</returns> public static WorkItem GetWorkItem(this PSCmdlet cmdlet, long id) { var cmdletParams = cmdlet.CreateParamDictionary().AddParam("Id", id); return(cmdlet.InvokeModuleCmdlet <WorkItem>("Get-WorkItem", cmdletParams).First()); }