title: Extracting Multiple 7z Files Overrides Same Folder
body: <p>I'm currently working on a project where I take multiple 7z files and extract the contents of these files in a folder named the same way as the 7z file itself. I also apologize if something like this has been answered already; I spent time trying to investigate this issue but I can't seem to find anyone else who has had a similar issue.</p>
  
  <p>For example:
  a1.7z -> <code>&lt;targetpath&gt;/a1/&lt;contents within a1.7z&gt;</code></p>
  
  <p>The following shell line: <code>a1.7z | % {&amp; "C:\Program Files\7-Zip\7z.exe" "x" $_.fullname "-o&lt;targetpath&gt;\a1" -y -r}</code></p>
  
  <p>Works like a dream, but only for one 7z file. However, whenever I start extracting a second 7z file, it won't create a new folder but instead will continue to add into the same first folder that is created; second folder is never made. When I manually highlight all of the 7z files I want to extract, right click and select "Extract to "*\", it does what I would like it to do but I can't figure out how to script this action. I should also mention that some of the 7z files, when extracted, can contain subfolders of the same name. I'm not sure if this is throwing off the recursion cycle, but I'm assuming this might be the case.</p>
  
  <p>Any help or advice on this topic would be greatly appreciated!</p>