Unzipping ZIP Files

by Jul 28, 2015

In PowerShell 5.0, there is a new cmdlet that can unzip ZIP files:

#requires -Version 5


$Source = 'C:\somezipfile.zip'
$Destination = 'C:\somefolder'
$Overwrite = $true
$ShowDestinationFolder = $true

Expand-Archive -Path $Source -DestinationPath $Destination -Force:$Overwrite

if ($ShowDestinationFolder) 
{
  explorer.exe $Destination
}

Twitter This Tip! ReTweet this Tip!