0

I have the following curl command that needs to be converted into equivalent powershell Invoke-WebRequest or Invoke-RestMethod:

curl --location --request GET 'https://adb-xxxxxxxxxxxxx.xx.azuredatabricks.net/api/2.0/workspace/list' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
  "path": "/"
}'

Since this is a GET request there is no way I could pass the --data-raw in either Invoke-WebRequest or Invoke-RestMethod. I have tried with -Body and -Form. Is there any other way the --data-raw could be passed?

Please note that I have tried the following link and the provided solution does not work in my case: Convert cURL to PowerShell Invoke WebRequest

Sormita Chakraborty
  • 813
  • 2
  • 12
  • 32
  • You can use the `C:\Windows\System32\curl.exe` that has been present in Windows since version 1803 of Windows 10. Just call it with `curl.exe`. – Diti May 21 '22 at 09:33

0 Answers0