Skip to content

Instantly share code, notes, and snippets.

@whereisaaron
Created March 27, 2022 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whereisaaron/2dcd2bea575883ba284cc77a7b88ee62 to your computer and use it in GitHub Desktop.
Save whereisaaron/2dcd2bea575883ba284cc77a7b88ee62 to your computer and use it in GitHub Desktop.
Unzip a tree of folders containing ZIP files, requires PowerShell and 7z
Get-ChildItem –Path "C:\temp" -Recurse |
Where-Object -Property Extension -EQ '.zip' |
Foreach-Object {
Write-Output $_.FullName
$command = "7z x ""$($_.FullName)"" -o""$($_.Directory)"" -aos -bso0 -bsp2"
Write-Output $command
Invoke-Expression $command
# Uncomment to remove ZIP file afterwards
#Remove-Item -Path $_.FullName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment