Microsoft.PowerShell.Archive icon indicating copy to clipboard operation
Microsoft.PowerShell.Archive copied to clipboard

Add ability to open password-protected ZIPs

Open joeyaiello opened this issue 9 years ago • 8 comments

Originally posted on Connect by Mark Wilson and now on UserVoice:

Please add a -Password switch to Expand-Archive so that it can open password-protected archive files. These files can currently be opened only through the GUI.

joeyaiello avatar Apr 21 '16 20:04 joeyaiello

I support this idea. The question is: are we really going to call it "Password" or "Credential"? Credential with its username is kind of ambiguous here. It should be accepted as secure string only either way.

megamorf avatar Apr 23 '16 16:04 megamorf

I think [-Password <SecureString>] makes more sense in this case.

KirkMunro avatar Apr 25 '16 12:04 KirkMunro

It's my understanding the underlying Windows OS doesn't support this and has always been enabled via third party tools like 7zip and WinZip, is my thinking invalid now?

imposhster avatar Apr 25 '16 23:04 imposhster

@imposhster I believe you are correct that the libraries this module depends on doesn't support it

SteveL-MSFT avatar Oct 12 '16 16:10 SteveL-MSFT

ITNOA

I think for add this ability, we need first add this ability to dotnet framework, so we have request this feature in .Net community

soroshsabz avatar Oct 26 '18 11:10 soroshsabz

It may be better to move to a 3rd party library that already supports passwords like https://github.com/icsharpcode/SharpZipLib which also supports gzip, tar, etc... and might also support zips larger than 4GB which is also a limiting factor with .NET's implementation

SteveL-MSFT avatar Oct 26 '18 17:10 SteveL-MSFT

@SteveL-MSFT So if you think this library stable enough, you can change Microsoft.PowerShell.Archive to use 3rd party open source library. I think this ability is very useful for powershell.

soroshsabz avatar Oct 26 '18 17:10 soroshsabz

I haven't done enough analysis to determine if moving to SharpZipLib is the right decision. I'll leave that to @anmenaga. However, the limits of the .NET APIs is quite apparent.

SteveL-MSFT avatar Oct 26 '18 20:10 SteveL-MSFT