Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created July 29, 2019 18:12
Show Gist options
  • Save PrateekKumarSingh/1dc3765a50e0e0cced63574316382304 to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/1dc3765a50e0e0cced63574316382304 to your computer and use it in GitHub Desktop.
# Method 1 - Using Expand-Archive cmdlet
Expand-Archive -Path C:\Data\Compressed.zip -DestinationPath C:\Data\one -Verbose
# Method 2 - Using .Net ZipFile Class
Add-Type -Assembly "System.IO.Compression.Filesystem"
[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\Data\Compressed.zip','C:\Data\two')
# Method 3 - Using Shell.Application COM object
$ZippedFilePath = "C:\Data\Compressed.zip"
$DestinationFolder = "C:\Data\three\"
[void] (New-Item -Path $DestinationFolder -ItemType Directory -Force)
$Shell = new-object -com Shell.Application
$Shell.Namespace($DestinationFolder).copyhere($Shell.NameSpace($ZippedFilePath).Items(),4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment