0

I am pretty new to powershell and I have a folder (c:\temp) with .zip drives. I am pretty sure I already unzipped them by doing

$shell = new-object -com shell.application
$zip = $shell.NameSpace(“C:\temp”)
foreach($item in $zip.items())
{
$shell.Namespace(“C:\temp”).copyhere($item)
}

I know I get copies by doing that, but besides wasting time/memory it is not the biggest of issues. My next goal is to make a variable $x that stores all the *.dll files which are located in multiple .zip drives. Some .zip files have 3 .dll files and other .zip files have none, but I need to be able to store each file.

Finally, I still have powershell 2.0 due to company restrictions.

  • You can call standard C# from Powershell, so this answer should apply: http://stackoverflow.com/a/307787/736079. I'd personally go for the ZipFile solution (http://msdn.microsoft.com/en-us/library/vstudio/system.io.compression.zipfile), since it relies on the standard framework libraries. – jessehouwing Jun 13 '14 at 13:37
  • 3
    Um, you mean .zip **files**? .zip drives are removable drives that used special diskettes, and connected via a cabled connection to the computer, and were popular in the early 1990s (I remember owning one that was a whopping 100MB in size). They also did not go in a `C:\temp` folder, and were not accessible via `$shell.NameSpace("C:\temp")`. – Ken White Jun 13 '14 at 13:50
  • possible duplicate of [Read a filename inside a zip file without extracting it in powershell](http://stackoverflow.com/questions/22954161/read-a-filename-inside-a-zip-file-without-extracting-it-in-powershell) – Raf Jun 13 '14 at 14:19

0 Answers0