0

I read a bunch of websites (included stack overflow posts and Microsoft website) about the file size limitation of 2GB
Microsoft Docs: Compress-Archive

"The Compress-Archive cmdlet uses the Microsoft .NET API System.IO.Compression.ZipArchive to compress files. The maximum file size is 2 GB because there's a limitation of the underlying API."

I have a PowerShell script to backup my Azure DevOPS projects using the Azure DevOPS RestAPI 5.0.

I download all my projects directly in zip format with the RestAPI then i use Compress-Archive to consolidate all the zipped projects into 1 "big" zip file

My total zipped projects files all together is equal to 5.19GB
After compressing to 1 big zip file with Compress-Archive, i got a zip file size of 5.14GB
I don't have any issue to uncompress it and I don't get any error although the 2GB limitation on the documentation.

I wonder if it's because i'm using Windows Server 2016 (so 64bits) so I don't have the 2GB file size limitation?

Anyone can confirm that? As the Microsoft documentation doesn't specify anything about it. Indeed, they stipulate that the issue is due to the API limitation of System.IO.Compression
Microsoft Docs: system.io.compression.ziparchive

As my zip will continue to grow, i would like to be sure that the zip won't be corrupted due to a file size limitation.

I can indeed use a 3rd-party library like Zip64, 7Zip, ... but i would like to only use the built-in compress method from PS/.Net

HoLengZai
  • 301
  • 3
  • 13
  • I found a vaguely answer here. But How do you know the limitation of each .Net Framework. I would like to know if it's related to the OS or the Framework or both? https://stackoverflow.com/questions/1153126/how-to-create-a-zip-archive-with-powershell?rq=1#comment70240809_29284372 – HoLengZai Nov 22 '19 at 10:10

1 Answers1

0

The 2GB limitation is for single Files inside the zip.

For example, if you try to Expand a .zip with an 2.1GB file inside it, it will trow an error.

HACB
  • 33
  • 4