#1 By: howtogeek, June 13th, 2013 12:36
Originally published at: http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/
Windows includes the ability to unzip archives and even exposes this functionality programmatically via COM. Here is how to do it.
#2 By: , June 13th, 2013 14:59
Instead of auguring about Windows 8, maybe this would be a better use of one's time. )
Click on the Link above.
#3 By: Iszi, June 13th, 2013 15:51
I think I'll still prefer 7-Zip over PowerShell for this. Nice to know the capability is built-in to the OS though.
#4 By: Netpilot, June 14th, 2013 10:32
@raphoenix Anyone can find books on the subject. The trick is to find a good, current one. Do you own any of those books or do you recommend one or two over the others?
@Iszi I agree that I wouldn't use the example by itself instead of 7-Zip, but If you are going to do something further to the unzipped files in a larger PowerShell script, the code snippet will be really useful.
#5 By: , June 14th, 2013 14:30
PowerShell is such important program included with Windows 7 and 8, I feel it is extremely important to learn the program.
Yes I own PowerShell books.
Recommend the 5 Star Books in the Amazon Link posted above.
May be we should have a Topic Named "What are you reading this Summer ?".
#6 By: David Ruhmann, June 24th, 2013 16:31
This PowerShell unzip ability is further enhanced by the optional second parameter for the CopyHere function.
I use vOption = 16 in my scripts. (Yes to All prompts)
PowerShell (New-Object -COM Shell.Application).NameSpace('DESTINATION').CopyHere((New-Object -COM Shell.Application).NameSpace('ZIPFILE.zip').Items(), 16);
#7 By: Iszi, January 10th, 2014 14:20
So, now that I've warmed up to PowerShell more recently, I actually ended up using this bit the other day to talk a Server Admin out of installing 7-Zip on a system that needed a command-line utility to extract a ZIP file in a batch job.
(I have zero objections to 7-Zip personally - in fact, I stated my preference for it earlier in this thread - but professionally, part of my job is ensuring that systems adhere to the security principle of Least Functionality. That is, essentially, you should avoid installing additional software whenever possible.)
A limitation I did find is that the command doesn't seem to be able to handle ZIP files which have an internal folder structure. Fortunately, that was not an issue for this particular use case.