title: powershell script to archive files in many subfolders
body: <p>i am trying to write down a script which can help me to archive multiple files in multiple subdirs. Also i need to exclude specific files.
   So far i got that few lines script </p>
  
  <pre><code>$files = Get-ChildItem -Recurse -path "D:\path\to\folder" -Exclude *i.jpeg |
    Where-Object { $_.FullName -notmatch '\\excludedir($|\\)' }
  foreach ($file in $files)
  {
    C:\Program Files\7-zip\7z.exe" a -t7z -mx=9 -ms=on $file
  }
  </code></pre>
  
  <p>Basically its searches recursively all subfolders for .jpeg files and  gives me the list of them excluding the ones that ends with  'i'.jpeg  lets say 'photoi.jpeg'.
  This is working, but i cannot make it to the next step as i need to run 7zip for all listed files. </p>
  
  <p>Can someone help me out here.
  Thanks in advance :)</p>