Conversation
`Invoke-RestMethod` converts the response from JSON to a PowerShell native object. From https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod > If the request returns JSON strings, `Invoke-RestMethod` returns a PSObject that represents the strings why are we calling `ConvertTo-Json` to convert it back to JSON? it's more useful to leave it as is. if you want just the raw text, use `Invoke-WebRequest` instead
|
@shreys7 Can you take a look at this? |
|
@shreys7 any updates on this? |
|
@gabrielsroka Thanks for the fix. Although can you just delete the |
|
@shreys7 i'm not sure where the unit test is (and how to update it...). any clues? |
|
@gabrielsroka There are unit tests for checking the snippet generation for PowerShell here: It tests for the snippet generated against some hard coded strings. Here, you need to remove the |
|
see #145 (i couldn't figure out how to add the new file to this PR) |
|
Closing, as new PR created. |
Invoke-RestMethodconverts the response from JSON to a PowerShell native object.From https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod
why are we calling
ConvertTo-Jsonto convert it back to JSON? it's more useful to leave it as is. if you want just the raw text, useInvoke-WebRequestinstead