Created
March 27, 2022 07:29
-
-
Save whereisaaron/2dcd2bea575883ba284cc77a7b88ee62 to your computer and use it in GitHub Desktop.
Unzip a tree of folders containing ZIP files, requires PowerShell and 7z
This file contains 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
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