Created
July 29, 2019 18:12
-
-
Save PrateekKumarSingh/1dc3765a50e0e0cced63574316382304 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
# 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