我想用PowerShell下载7zip文件,例如我尝试过的Notepad++
"Invoke-WebRequest https://github.com/notepad-plus-plus/notepad-plus-plsu/releases/download/v8.1.4/npp8.1.4.portable.7zip -OutFile package.zip"
我得到了以下错误信息
Invoke-WebRequest : Die Anfrage wurde abgebrochen: Die Verbindung wurde unerwartet getrennt..
In Zeile:1 Zeichen:1
+ Invoke-WebRequest https://github.com/notepad-plus-plus/notepad-plus-p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand我做错了什么?
发布于 2021-08-30 09:03:33
你没有做错什么。这是一个好的命令,它与另一个链接一起工作。
你链接了https://github.com/notepad-plus-plus/notepad-plus-plsu/releases/download/v8.1.4/npp8.1.4.portable.7zip return 404错误,所以你不能下载它。
如果你想确认,你可以尝试这个链接:https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.1.4/npp.8.1.4.portable.7z
因此,运行以下命令:
Invoke-WebRequest https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.1.4/npp.8.1.4.portable.7z -OutFile package.zip它工作得很好。
(警告:我使用我找到的第一个文件,所以它可能不是您想要的扩展名)
https://stackoverflow.com/questions/68981354
复制相似问题