我一直在尝试用许多命令在windows powershell中下载文件
调用-Web请求“https://www.7-zip.org/a/7z2201-x64.exe”-输出文件“C:\用户\Nati”
这就是错误
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, function, script file, or op
ck the spelling of the name, or if a path was included, verify that the path is correct and try agai
At line:1 char:18
+ Invoke-WebRequest <<<< 'https://www.7-zip.org/a/7z2201-x64.exe' -OutFile 'C:\Users\Nati\Documents
+ CategoryInfo : ObjectNotFound: (Invoke-WebRequest:String) [], CommandNotFoundExceptio
+ FullyQualifiedErrorId : CommandNotFoundException
有什么想法吗?
我尝试了Invoke-Request方法,我认为它能够安装
1条答案
按热度按时间lf5gs5x21#
您需要在
-OutFile
中指定一个实际的文件,而不是目录。但正如评论中所说,
Invoke-WebRequest
只是PowerShell 3. 0及更高版本的一部分。参见MS Learn - Invoke-WebRequest