-
Notifications
You must be signed in to change notification settings - Fork 37
Compress-Archive
on Windows PowerShell generates an archive incompatible with OS X Archiver
#11
Comments
Is there an alternative to zipping archives in PowerShell other than resorting to using batch or another language? I'm experiencing the same issue on AppVeyor as documented by @vors on the original issue. I'm not aware of any way to switch to CoreCLR on AppVeyor, so pretty much limited to FullCLR and this bug. |
I have a similar issue, when I package a dotnet core app for AWS Lambda, Lambda says it cannot load my assembly, however if I compress the same files with macOS or zip in terminal it works fine. I even resorted to try and call the terminal zip from powershell but its complaining about "*", if I run the same command in terminal it works fine |
@lukespragg unfortunately, I don't know of any way to use PowerShell Core as the default in an AppVeyor instance (of course, you could always download PS 6 and unzip it, but that's gonna add some serious time to your CI runs) @eugeneniemand I'm not sure I understand you here: are you using PowerShell Core to generate the ZIP (thereby eschewing the bug in FullCLR that you're hitting)? (And yeah, the globbing/ |
Oh, one work around that should work from PowerShell (haven't validated, but I'd bet it works): |
@joeyaiello, I opted for a batch snippet for now with 7z as it's installed by default on AppVeyor. I could probably use PowerShell to trigger that as well, but it works for now. :) |
@lukespragg sounds good. I was wondering what you were using when you said you could 'just use batch', didn't realize that AppVeyor bundled 7z by default. 👍 |
Ping. This is very annoying for macOS users. |
For those having issues and looking for a comparable alternative, I ended up going with the following: Install-Module 7Zip4PowerShell -Force -Verbose
Compress-7Zip "Path\To\Files" -ArchiveFileName "OutputName.zip" -Format Zip The -Force is needed if you're using this on AppVeyor. I was using 7z directly before since AppVeyor includes that, but the 7Zip4PowerShell module makes it a little cleaner. Tested and had no issues with the archives on macOS, Linux, and Windows. |
Sure it works, when you can change the packaging steps on the projects. The problem is when you are not controlling the project and just downloading the zips. |
Could someone please merge this simple pull request? This module is kind of useless because of this bug, but worse, it wastes time when people try to use it and create broken archives. Took us a couple of hours to understand why AWS Lambda was unhappy with our zip files. |
I can reproduce this issue on the latest
|
See PowerShell/PowerShell#2140 for details
The text was updated successfully, but these errors were encountered: