卷曲错误:由于参数名称“ u”不明确,无法处理参数

时间:2018-09-14 17:57:39

标签: powershell curl

我正在尝试通过PowerShell连接(在PowerShell中) 卷曲 但没有成功。

下面是我为了建立连接而插入的以下代码:

  curl -u <USER>:<PASSWORD> https://something.com

但出现错误:

  Invoke-WebRequest : Parameter cannot be processed because the parameter name 'u' is ambiguous. 
  Possible matches include: -UseBasicParsing -Uri -UseDefaultCredentials -UserAgent.

所以,我试图在SO上寻找解决方案,例如:

PowerShell's Invoke-RestMethod equivalent of curl -u (Basic Authentication)

Running cURL on 64 bit Windows

以及在GitHub上: https://github.com/PowerShell/PowerShell/issues/4351

但是没有成功。 我还重新安装了计算机中的“ curl”,并尝试直接使用 Invoke-WebRequest ,但问题仍然存在。

我是PowerShell的新手,也许我在对这些行进行编码时犯了一个错误,但是您对如何处理有任何建议吗? 您认为使用 curl 比使用PowerShell更好的命令提示符/ CLI吗?

0 个答案:

没有答案