Sometimes I have to deal with powershell and curl type functionality. It is possible to just use the webrequest function but there is also a more specific call for api’s when you are dealing with json. It makes it a bit easier not to have to convert responses. I show below the regular webrequest vs restmethod and I boiled it down to one liners but its more clear if you break it up to see the different outputs.
$uri="https://dev.example.com/services"
(Invoke-WebRequest -Uri $uri | Select-Object -ExpandProperty Content | ConvertFrom-Json).records
Invoke-RestMethod -Uri $uri -Method GET | Select-Object -ExpandProperty records