Unzip several files with PowerShell

Here is a function I used to unzip several files using PowerShell. 

function UnZipMe($zipfilename,$destination)
   $shellApplication = new-object -com shell.application
   $zipPackage = $shellApplication.NameSpace($zipfilename)
   $destinationFolder = $shellApplication.NameSpace($destination)

# CopyHere vOptions Flag # 4 - Do not display a progress dialog box.
# 16 - Respond with "Yes to All" for any dialog box that is displayed.


$a = gci -Path C:\inetpub\iislogs3.com\wwwlogs -Filter *.zip

foreach($file in $a)
    Write-Host "Processing - $file" UnZipMe –zipfilename
    $file.FullName -destination $file.DirectoryName

No Comments