Monday, April 08, 2013

Powering your Zipping with PowerShell and 7-Zip (and SevenZipSharp) (aka '7Zip4Powershell')

Thomas Freudenberg - 7-Zip for Powershell

At work we deal with different big databases, and by big I mean between 3.5 and 8 GB. Those databases are zipped with 7-Zip and stored on a server. Depending on the scenario we unzip one of these databases to a local folder and attach it to the SQL Server. To simplify these steps we have a couple of Powershell scripts, among other things invoking the command line version of 7-Zip.

However, extracting an archive of several gigabytes over the network might take some time, and we’d like to see the progress in the Powershell console. Powershell provides a standard way to report progress by calling Cmdlet.WriteProgress, which then will be displayed by the current host (e.g. command line) appropriately.

Therefore with some support of a co-worker I’ve written two Cmdlets for extracting and compressing archives. The syntax is simple as this:

image

..."

thoemmi / 7Zip4Powershell

image

7Zip, PowerShell, SevenZipSharp .Net assembly? All used together? Cool...

 

Related Past Post XRef:
7zSharp to your .Net Archive/Unarchiving Rescue - LGPL .Net Wrapper for 7z
.Net (C#) Interface for the 7-Zip DLL (7z.DLL)

No comments: