powershell - 使用 powershell 解压缩嵌套的 zip 文件
问题描述
我有以下结构 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
如果要覆盖现有文件,请使用。
推荐阅读
- permissions - 将自定义数据输入 GraphiQL Docs
- azure - ARM 模板,带有 Web 作业的 Web 应用服务
- python - 在 Python 中使用具有并发期货的互斥锁
- spring - SpringBootTest 与 Zuul 代理 - 空响应
- javascript - Angular 添加随机 JPG 图像?
- mysql - mysql nodejs连接太多
- visual-studio-code - 将 JavaCC 语法定义转换为 VSCode 语法高亮?
- r - 在 GitHub Actions .yaml 中为 R 包配置 codecov 令牌
- exec - 为什么 dows exec() 函数可以在原始代码中工作,但不能在 Python 3.7 中的函数或类中工作?
- angular-material - 角9更新后角材料损坏