Last active
August 29, 2015 14:08
-
-
Save sweeneyrobb/73dc26f3aea1bc722b6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Extract-Zip ($zipFile, $directory = ".\") { | |
if ($directory -is [string]) { | |
$directory = Get-Item $directory } | |
if ($zipFile -is [string]) { | |
$zipFile = Get-Item $zipFile } | |
$zip = (New-Object -ComObject shell.application).NameSpace($zipFile.FullName) | |
$destination = (New-Object -ComObject shell.application).namespace($directory.FullName) | |
if ($directory.PSIsContainer) { | |
$destination.CopyHere($zip.Items()) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment