简体   繁体   English

Powershell文件压缩到多个zip文件

[英]Powershell file compression to multiple zip files

In a Powershell script, I've created zip file archives using functions like 在Powershell脚本中,我使用以下功能创建了zip文件档案

[io.compression.zipfile]::CreateFromDirectory.

Now these archives are getting large, and I need to break them down to files that are under 5GB. 现在这些档案越来越大,我需要将其分解为5GB以下的文件。 So, I've been looking through some of MS API documents on file compression looking for some type of disk spanning feature, or making archives spread out over multiple files. 因此,我一直在浏览一些有关文件压缩的​​MS API文档,以寻找某种类型的磁盘扩展功能,或者使归档分布在多个文件中。

Does anyone know of a .Net or Powershell cmdlet that can do this? 有谁知道可以执行此操作的.Net或Powershell cmdlet?

Thanks! 谢谢!

I guess you've already read about the file size limitation: 我想您已经了解了文件大小限制:
powershell compress-archive File size issue Powershell压缩存档文件大小问题

zip file size in powershell Powershell中的zip文件大小

Compress-Archive 压缩存档

Because Compress-Archive relies upon the Microsoft .NET Framework API System.IO.Compression.ZipArchive to compress files, the maximum file size that you can compress by using Compress-Archive is currently 2 GB. 因为Compress-Archive依赖于Microsoft .NET Framework API System.IO.Compression.ZipArchive来压缩文件,所以当前可以通过使用Compress-Archive压缩的最大文件大小为2 GB。 This is a limitation of the underlying API. 这是基础API的限制。

May be you could use 7zip's volume option /v4GB 可能是您可以使用7zip的音量选项/v4GB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM