Unzip files and move to a destination folder depending on the filename
<p>I am trying to move files within the zip folders. The names of the Zip Folders changes every months.</p>

<ol>
<li>OH_M7_AEE.zip</li>
<li>OH_M7_AOP.zip</li>
<li>OH_M7_AIP.zip</li>
</ol>

<p>The zip folders have subfolders called <strong>GM7_AAA_files</strong> which also changes on a monthly basis.</p>

<p>What I would like to do is move the csv files within the subfolders to their destination folders.  </p>

<p>So in <strong>OH_M7_AEE.zip</strong> there is a subfolder called <strong>GM7_AAA</strong> and I would like to move the <strong>109EM_Main.csv</strong> to folder <strong>Test2</strong> and <strong>109EM_Main.csv</strong> to Folder <strong>Test2</strong>. </p>

<p>So far I just managed to move the subfolder with the csv files not what I exactly want. </p>

<pre><code>$path = "\\networkdrive\2. Digital\Test"

$destination = "\\networkdrive\2. Digital\Test2"

$shell_app= New-Object -com shell.application

$files = Get-ChildItem -Path $path -filter *.zip -recurse

foreach($file in $files) {

  $zip_file = $shell_app.namespace($file.FullName)

  $copyHere = $shell_app.namespace($destination)

  $copyHere.Copyhere($zip_file.items())

}
</code></pre>

<p>Hope I made sense and apologies if I didn't. I appreciate any help given.</p>