I am using the 'execute process task' to call the powershell compress-archive command.
For small files it works fine.
For a file of 1.25GB it is failing. It starts processing then 'finishes' but no file is created.
Given that the compress-archive should work with files up to 2GB, why is this occurring and what other options do I have?
7zip is not an option due to having no control over server installs.
Compress-Archive is a simplified wrapper around the System.IO.Compression.ZipArchive .Net library. Some features are not supported, such as storing relative path. Exception handling and reporting is weak. I usually choose to use the .Net library directly for any zipping task that requires robust exception handling.
The code isn't much more complicated with a transcript (always a good idea for unattended jobs) and error handling. This may not solve your problem, but it will likely give you more information:
The roughly equivalent code using Compress-Archive:
However
Compress-Archiveoverwrites entries inside the .Zip archive on subsequent runs.CreateEntryFromFilecreates duplicate entries within the archive.