Creating 7zip files

Topics: Developer Forum, User Forum
Oct 28, 2011 at 9:01 PM

after doing a quick search, i am not seeing a way to write a 7zip only to expand one via expand-archive.   Looking at the source briefly, I dont see the appropriate command.  Can somebody confirm that it does not work?  Is there some barrier to implementing it?

Developer
Oct 29, 2011 at 1:00 AM

Do you mean extract a single file from a 7z file?

Oct 29, 2011 at 1:39 AM

The opposite.  I want to be able to create 7zip files  (lzma or lzma2)

Nov 1, 2011 at 2:30 PM

Are you trying to do this without using the 7zip command line program? I just call it directly in powershell.

  & '7z' a -mx3 -tzip $zipfile $file

Nov 1, 2011 at 4:58 PM

JSaint,

thank you for your reply.  I am aware of calling the 7z  directly but i dont get the same benefit if I had a commandlet to accomplish the task similarly to write-zip.  That's why i was curious to find out why there isn't one out there for creating lzma compression files.

Developer
Nov 1, 2011 at 7:57 PM

@rroman81

When I first wrote the compression cmdlest in Pscx a few years ago, the only reasonable library around was SharpZipLib and it only supported Tar,Zip,GZip and BZip2 for writing. The read support came from something else I had to write mostly myself which wrapped the 7z.dll. There are much better libraries around now to do read and write with a great deal more formats. I do plan to overhaul these cmdlets, but probably not until Pscx 3.0 which is a few months away. Sorry!

-Oisin

Feb 29, 2012 at 6:24 PM

@oisin,

I was just curious to see what library would you have in mind.  Do you need assistance towards Pscx 3.0?  I have been working with pscx lately for automation puproses and would love to see that  feature completed for 3.0.