【发布时间】:2018-04-21 08:42:59
【问题描述】:
我正在尝试使用 wget 从网站下载文件,我尝试了我在网上找到的这个命令:
wget -r -l1 -H -t1 -nd -N -np -A.zip -erobots=off https://website.name/mydownloads.php
我在我的一个文件夹中启动了powershell,并在那里使用了该命令,但它返回:
Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "-t1" value of type "System.String" to type "Sy
stem.Collections.IDictionary".
At line:1 char:13
+ wget -r -l1 -H -t1 -nd -N -np -A.zip -erobots=off https://website.na ...
+ ~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
这是因为我没有正确安装 wget 还是我做错了什么?
【问题讨论】:
-
使用
wget.exe- 否则你正在调用PowerShells Invoke-Webrequest(正如它在你的错误消息中所说)。搜索 SO 的原因。已经回答了几十次了。 -
从哪里启动 PowerShell?它找不到 wget.exe,但我不知道它在我的电脑上的位置@Swonkie
-
wget.exe是第 3 方应用程序。它在 Linux 系统上无处不在。
标签: powershell powershell web wget