15

I'm trying to install Airflow with docker on my desktop.

When I run curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.2.3/docker-compose.yaml' like the internet says, I get 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 can't find any info over the web :(

Olivia Stork
  • 4,660
  • 5
  • 27
  • 40
Cesar Rodriguez
  • 151
  • 1
  • 1
  • 3

2 Answers2

66

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.

Olivia Stork
  • 4,660
  • 5
  • 27
  • 40
Newnab
  • 811
  • 1
  • 7
  • 7
0

The above answer works perfectly but for poeple who don't want to mess with powershell, just run wsl (Windows Subsystem for Linux) if you have it and let windows deal with it's own issues. This command would run without error in an Ubuntu terminal.