gci -Path "G:\_complete" -r -include *.zip,*.rar,*.7z | foreach { & 'C:\Program Files\7-Zip\7z.exe' x $_.FullName -y -o"$('"'+$_.DirectoryName+'"')"} Remove-Item –path G:\_complete -include *.7z,*.zip,*.rar -recurse