Curl -xget gives an error in powershell 5.1

Viewed 1465

As you can see, curl -xget is working fine in PS 7.2 and cmd, but gives an error in PS 5.1.

Invoke-WebRequest : A parameter cannot be found that matches parameter name 'xget'.

What am I doing wrong?

Screenshot of the error, Powershell windows side by side

2 Answers

When you are calling curl in cmd and PowerShell Core it is calling the executable in %SYSTEMROOT%\System32\curl.exe while in PowerShell Desktop it is calling the Invoke-WebRequest command which does not have the xget parameter

If you want to use xget in PowerShell you have to use the curl.exe command instead

-X ≈ --request 
-x ≈ --proxy

Maybe you should've used the capital letters in -XGET.

Related