Extract files to same folder as archive using recursive to search all directories
问题 I'm working on an automation task in PowerShell that extracts the contents of several .tar archives to their respective subfolders using recursion and the 7z.exe utility. Im running into an issue where the output dumps in my working directory instead of the subdirectory gci -r found the original tarball. So far I have: $files=gci -r | where {$_.Extension -match "tar"} foreach ($files in $files) { c:\7z.exe e -y $file.FullName } Advice on setting the working directory within the loop or 7z