![]() ![]() ![]() I have additional testing and QA to do but initial results look good. I can see a ton of additional work I can do now that I can enumerate the json objects returned from the invoke-webrequest. $data = $return.Content|ConvertFrom-Json|foreach-object $return = Invoke-WebRequest -Uri $uri -Method POST -Headers $headers I am getting all the objects where the closed_at value is null. My issue though was that no matter what I did I could not pass the -G -d ‘only_open=true’ Flag to invoke-webrequest. So I want to return all the violations where the only_open value it true like I get in the API Explorer. These commands allow you to quickly work with REST APIs or any other service that returns or accepts JSON as an input. When working with PowerShell, Microsoft has provided some helpful tools to work with JSON called the ConvertTo-Json and ConvertFrom-Json commands. ![]() The main issue though with other tools is that most of my customers are not going to go through the steps to install another curl.exe utility. JSON is a way of structuring data that makes it easy for software to consume. Chocolatey Software | Installing Chocolatey (this article is not about choclatey.) This command works from a powershell prompt to use the curl.exe from chocalatey that I installed in a previous step.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |