title: Send only selected files and folders to Compress-Archive
body: <p>Inside <code>c:\test\</code> I have:</p>
  
  <ul>
  <li>.\dir1</li>
  <li>.\dir2</li>
  <li>.\dir3</li>
  </ul>
  
  <p>and</p>
  
  <ul>
  <li>file1.txt</li>
  <li>file2.txt</li>
  <li>file3.txt</li>
  <li>file4.txt</li>
  </ul>
  
  <p>I want to compress only <code>dir1</code>, <code>dir2</code>, <code>file1.txt</code> and <code>file2.txt</code></p>
  
  <p>I use the following script to compress selected folders </p>
  
  <pre><code>$YourDirToCompress="C:\test\"
  $ZipFileResult=".\result.zip"
  $DirToInclude=@("dir1", "dir2")
  
  Get-ChildItem $YourDirToCompress -Directory  | 
             where { $_.Name -in $DirToInclude} | 
                Compress-Archive -DestinationPath $ZipFileResult -Update
  </code></pre>
  
  <p>How would I be able to add my selected files (<code>file1.txt</code> &amp; <code>file2.txt</code>) to final compressed <code>result.zip</code>?</p>
  
  <p>Ideally I want the compression to happen in one go meaning I pass the list of selected files and folders and then do the compression.</p>