July 4, 2025

USEFUL-IT

A blog for USEFUL-IT information

Extract Content from Zip

PowershellExtract contents from a zip file using PowerShell.

 

Other Scripts in this range
New-zip Get-zip Extract-Zip Move-Zip Copy-Zip

############################################################
#
#    NAME : Extract-Zip
#
#    AUTHOR : Wessel van Sandwijk
#
#    Website : http://www.useful-it.nl
#
#    COMMENT : Extract contents from a ZipFile
#
#    VERSION HISTORY :
#    1.0  07-MRT-2013  -  Initial Version
#
############################################################

Extract-Zip c:\demo\myzip.zip c:\demo\destination

############################################################
#
#    FUNCTIONS
#
############################################################
function Extract-Zip
{
    param([string]$zipfilename, [string] $destination)
    if(test-path($zipfilename))
    {
        $shellApplication = new-object -com shell.application
        $zipPackage = $shellApplication.NameSpace($zipfilename)
        $destinationFolder = $shellApplication.NameSpace($destination)
        $destinationFolder.CopyHere($zipPackage.Items())
    }
}

About The Author