-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update obsolete API * Remove automated tweet * Add new New-TfsUser cmdlet * Update build tasks to use PowerShell 7 * Remove docgen from build * Build before debug * Add alias * Update manifest version * User three-part version for WinGet package * Revert change * Move JSON-related extensions to separate file * Rename property to avoid conflict with DisplayName arguments * Move template-based API call support to IRestApiService * Add automatic conversion of JSON objects to PowerShell format * Add new cmdlet * Add Remove-TfsUser * Fix typo * Update release notes +semver: minor * Add proper support for project/team parameters
- Loading branch information
Showing
20 changed files
with
594 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Newtonsoft.Json.Linq; | ||
using System.Net.Http; //.HttpResponseMessage | ||
|
||
namespace TfsCmdlets.Extensions { | ||
public static class JsonExtensions { | ||
|
||
public static JObject ToJsonObject(this string self) | ||
{ | ||
return Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(self); | ||
} | ||
|
||
public static T ToJsonObject<T>(this string self) | ||
{ | ||
return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(self); | ||
} | ||
|
||
public static JObject ToJsonObject(this HttpResponseMessage self) | ||
{ | ||
var responseBody = self.Content.ReadAsStringAsync().GetAwaiter().GetResult(); | ||
return ToJsonObject<JObject>(responseBody); | ||
} | ||
|
||
public static T ToJsonObject<T>(this HttpResponseMessage self) | ||
{ | ||
var responseBody = self.Content.ReadAsStringAsync().GetAwaiter().GetResult(); | ||
return ToJsonObject<T>(responseBody); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.