Categories
PowerShell Scripting

PowerShell Unzip Function

A small PowerShell function for unzipping a file.

function fUnzip([string]$sZIPFileName, [string]$sExtractToDir) {
  $oShell = new-object -com shell.application
  $oZIPFile = $oShell.namespace("$sZIPFileName")
  $oExtractTo = $oShell.namespace("$sExtractToDir")
  $oExtractTo.Copyhere($oZIPFile.items())
}