This works for me with PowerShell version 4.0 or higher. But at PowerShell version 2.0 the Add-Type
isn't possible (type doesn't exist).
function unzip {
Add-Type -Assembly “system.io.compression.filesystem”
[io.compression.zipfile]::ExtractToDirectory("SOURCEPATH\ZIPNAME", "DESTINATIONPATH")
}
function Expand-ZIPFile($file, $destination)
{
$shell = new-object -com shell.application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
{
$shell.Namespace($destination).copyhere($item)
}
}
This leverages Windows's built in zip file support, via the Shell.Application object. To use this, run the following.
>Expand-ZipFile .\Myzip.zip -destination c:\temp\files
Source: http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/