簡體   English   中英

使用 powershell 解壓縮嵌套的 zip 文件

[英]Unzip nested zip files with powershell

我有以下結構 Folder\zip\zip1, zip2, zip3

我想將 zip1、zip2、zip3 中包含的所有文件提取到一個文件夾中。

我嘗試使用 Expand-Archive,但無法超出 zip 文件夾。

如果結構如下所示:

/Folder/
  /Foo.zip
    /1.zip
    /2.zip

那么最簡單的方法是:

Expand-Archive -LiteralPath 'c:\folder\Foo.zip' -DestinationPath 'C:\temp\Foo-expanded\'

# Get all the nested zip files, and expand them to the same folder:
Get-ChildItem 'C:\folder\expanded\*.zip' | 
  Expand-Archive -DestinationPath 'C:\folder\SingleFolder\'

如果要覆蓋現有文件,請使用Expand-Archive -Force

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM