Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Place this script inside the folder that contains your ZIP files and run it from there.
- Add-Type -AssemblyName System.IO.Compression.FileSystem
- function Unzip
- {
- param([string]$zipfile, [string]$outpath)
- [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
- }
- ## Uncomment the specific line you need. Edit the file paths to meet your requirements. NOTE: Files that already exist in the destination folder will be overwritten without warning.
- ## Use this line to unzip a specific ZIP file.
- #Unzip "C:\path\to\ZIP_file.zip" "C:\path\to\destination\folder\"
- ## Use this line to unzip all ZIP files in a folder to the same destination.
- #Get-Childitem | where {$_.extension -eq ".zip" | % {Unzip $_.FullName "C:\path\to\destination\folder\"}
- ## Use this line to unzip all ZIP files in a folder and all subfolders to the same destination.
- #Get-Childitem -recurse | where {$_.extension -eq ".zip" | % {Unzip $_.FullName "C:\path\to\destination\folder\"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement