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

Viewed 4638

Im trying to install Airflow with docker in mi desktop. I run "curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.2.3/docker-compose.yaml' " justo like the web page says. But appears this :

Invoke-WebRequest : A parameter cannot be found that matches parameter name 'LfO'. At line:1 char:6

  • curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.2.3/docke ...
  •  ~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

And I dont see any info over the web :(

1 Answers

This question ranks highly on Google for some reason, which means I regularly click through here when I encounter this issue. For the sake of my sanity, and anyone else who arrives here, here's the answer:

Execute this in the command prompt:

Remove-item alias:curl

Explanation: There's a CmdLet called Invoke-WebRequest which has an alias of curl. So when you execute this command, rather than using curl, it tries to use Invoke-WebRequest. Removing this alias allows you to execute curl as you intended.

Windows Terminal seems to have Invoke-WebRequest set up by default, so I occasionally find myself needing to run the remove-item.

Related