Added -usebasicparsing and it seemed to resolve the issue
$products = Invoke-WebRequest -Uri $uri -contentType "application/json" -Method Get -Headers $headers -UseBasicParsing | ConvertFrom-Json
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am trying to get API's working with Powershell
I have the following code
$uri = "https://home-everything.myshopify.com/admin/api/2021-04/orders.json"
$apikey = "Username"
$password = "Password"
$headers = @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($apikey+":"+$password))}
$products = Invoke-WebRequest -Uri $uri -contentType "application/json" -Method Get -Headers $headers | ConvertFrom-Json
However the error I am receiving is
Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try
again.
The URL I am trying to use that works in a browser is
https://username:Password@home-everything.myshopify.com/admin/api/2021-04/orders.json
Any help appreciated.. trying to get this to work.
Added -usebasicparsing and it seemed to resolve the issue
$products = Invoke-WebRequest -Uri $uri -contentType "application/json" -Method Get -Headers $headers -UseBasicParsing | ConvertFrom-Json