简体   繁体   English

Invoke-WebRequest:找不到与参数名称“LfO”匹配的参数

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

Im trying to install Airflow with docker in mi desktop.我试图在 mi 桌面上安装 Airflow 和 docker。 I run "curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.2.3/docker-compose.yaml' " justo like the web page says.我运行“curl -LfO'https://airflow.apache.org/docs/apache-airflow/2.2.3/docker-compose.yaml'”就像web页面说的那样。 But appears this:但出现这样的:

Invoke-WebRequest: A parameter cannot be found that matches parameter name 'LfO'. Invoke-WebRequest:找不到与参数名称“LfO”匹配的参数。 At line:1 char:6在行:1 字符:6

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

And I dont see any info over the web:(而且我没有看到关于 web 的任何信息:(

see the first answer here .这里看到第一个答案。 Had the same issue and this solved it.有同样的问题,这解决了它。 Hope it helps you too.希望对你也有帮助。

Cheers干杯

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.说明:有一个名为 Invoke-WebRequest 的 CmdLet,其别名为 curl。 So when you execute this command, rather than using curl, it tries to use Invoke-WebRequest.因此,当您执行此命令时,它会尝试使用 Invoke-WebRequest,而不是使用 curl。 Removing this alias allows you to execute curl as you intended.删除此别名允许您按预期执行 curl。

Windows Terminal seems to have Invoke-WebRequest set up by default, so I occasionally find myself needing to run the remove-item. Windows 终端似乎默认设置了 Invoke-WebRequest,所以我偶尔会发现自己需要运行 remove-item。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM