0

In a Powershell script, I've created zip file archives using functions like

[io.compression.zipfile]::CreateFromDirectory.

Now these archives are getting large, and I need to break them down to files that are under 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.

Does anyone know of a .Net or Powershell cmdlet that can do this?

Thanks!

Mike Goldweber
  • 327
  • 1
  • 4
  • 10

1 Answers1

3

I guess you've already read about the file size limitation:
powershell compress-archive File size issue

zip file size in powershell

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. This is a limitation of the underlying API.

May be you could use 7zip's volume option /v4GB

Community
  • 1
  • 1
  • Thanks for responding. Ironically, I didn't learn about the 2GB limit until I read about it the other day. My Powershell scripts have been regularly producing much larger zip files. I'm wondering if there isn't a 2GB limit on Windows Server? Prior to seeing your post I found some things in the WinZip software that allowed me to break up the zip file into smaller files. If I hadn't found it there I would've checked out 7z. Thank you for your help! – Mike Goldweber Dec 07 '16 at 14:04
  • I have the also used `Compress-Archive` to create archives up to 6GB and only read about the 2GB limit today. This clearly does not apply on Windows servers. – Frode Evensen Mar 30 '23 at 08:15