小编Mag*_*eit的帖子

使用 PowerShell 下载并解压存档

使用 PowerShell 5.1,如何下载tar.xz存档并解压而不先将其写入磁盘?

所有这些尝试:

Invoke-WebRequest https://www.examle.com/archive.tar.xz -UseBasicParsing | 7z x -si
(Invoke-WebRequest https://www.examle.com/archive.tar.xz -UseBasicParsing).ToString() | 7z x -si
(Invoke-WebRequest https://www.examle.com/archive.tar.xz -UseBasicParsing).Content | 7z x -si
(Invoke-WebRequest https://www.examle.com/archive.tar.xz -UseBasicParsing).RawContent | 7z x -si
Run Code Online (Sandbox Code Playgroud)

给出这个错误:

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Extracting archive:
ERROR:
Can not open encrypted archive. Wrong password?

Not implemented

Can't open as archive: 1
Files: 0
Size:       0
Compressed: 0
Run Code Online (Sandbox Code Playgroud)

这有效:

Invoke-WebRequest https://www.examle.com/archive.tar.xz -UseBasicParsing -OutFile temp.tar.xz
7z x temp.tar.xz
Run Code Online (Sandbox Code Playgroud)

powershell wget tar curl 7-zip

5
推荐指数
1
解决办法
4526
查看次数

标签 统计

7-zip ×1

curl ×1

powershell ×1

tar ×1

wget ×1