I'm looking for an one-liner that will zip/unzip files (*.zip) in powershell
-
You may wish to check out http://www.codeplex.com/Pscx which has cmdlets specifically for this.
marc_s : +1 PSCX is a great set of add-on cmdlets - I just wish I could pick and choose more which ones I want and which I don't. It seems to be changing a whole lot in my Powershell instance....From Kevin Colby -
DotNetZip will allow you to do this from Powershell
http://www.codeplex.com/DotNetZip
Not a one-liner but the library will allow you to write the Powershell script you need.
You can also use the COM interface
Of course, I found this by googling "zip powershell" or "unzip powershell". Might want to try that as a resource too.
From Kevin Kuphal -
I find the simplest solution to just use infozip binaries which I have used for years and use in a UNIX environment.
PS> zip -9r ../test.zip * PS> cd .. PS> unzip -t test.zip Archive: test.zip testing: LinqRepository/ OK testing: LinqRepository/ApplicationService.cs OK testing: LinqRepository/bin/ OK ... No errors detected in compressed data of test.zip.
It would be straighforward to put a powershell wrapper around the text output but in practice I never need that so I haven't bothered.
From Brian Reiter -
WinRAR can work in CMD mode accepting arguments
From adopilot
0 comments:
Post a Comment