PowerShell使用wget只输出信息不下载问题

PowerShell wget Windows 大约 1179 字

问题

直接使用wget拼接一个url地址,将会在控制台得到HTTP信息,而不是完整的文件。

PS C:\Users\fendoudebb\Desktop> wget https://unpkg.com/element-ui/lib/theme-chalk/index.css


StatusCode        : 200
StatusDescription : OK
Content           : @charset "UTF-8";.el-pagination--small .arrow.disabled,.el-table .hidden-columns,.el-table td.is-hidden>*,.el-table th.is-hidden>*,.el-table--hidden{visibility:hidden}.el-input__suffix,.el-tree.is-dra...
RawContent        : HTTP/1.1 200 OK
                    Transfer-Encoding: chunked
                    Connection: keep-alive
                    Vary: Accept-Encoding
                    Access-Control-Allow-Origin: *
                    X-Cloud-Trace-Context: 2508d4b572bce42f2bfab5db530d46da
                    Age: 583615
                    CF-Cac...
Forms             : {}
Headers           : {[Transfer-Encoding, chunked], [Connection, keep-alive], [Vary, Accept-Encoding], [Access-Control-Allow-Origin, *]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : System.__ComObject
RawContentLength  : 232432

解决

添加-OutFile属性指定保存的文件名。

wget https://unpkg.com/element-ui/lib/theme-chalk/index.css -OutFile "index.css"
阅读 269 · 发布于 2020-12-07

————        END        ————

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批