title: check if file in folder already exist based on conditional statment
body: <p>I have two folders</p>
  
  <ul>
  <li>C:\Folder1 </li>
  <li>C:\Folder2</li>
  </ul>
  
  <p>Both folder contain *.txt files with different numbered files names (eg. 01.txt, 02.txt...10.txt)</p>
  
  <p>The script compares files present in both folders. Then only copies files from "Folder1" which aren't present in the "Folder2" or viceversa to C:\TestFolder.</p>
  
  <p>For example if:</p>
  
  <ul>
  <li>Folder1 contains a single File called 10.txt </li>
  <li>Folder2 contains multiple files 02.txt,10.txt</li>
  </ul>
  
  <p>Then 02.txt would be the only file that is copied to C:\Testfolder.</p>
  
  <p>I would to modify below script to add the following functionality:</p>
  
  <ul>
  <li>If the file present in Folder1 is newer then "all" the files in  Folder2: do nothing.</li>
  <li>If the file in the Folder1 is newer then "some" of the file on the Folder2: copy the newer files to Folder3.</li>
  </ul>
  
  <p>Basically I need to check if the file present in Folder1 already exists in  Folder2. Also verify if this file is the same, or if a newer version of a file/files are present in Folder2.</p>
  
  <pre><code>Compare-Object $Folder1 $Folder2 -Property Name, Length , LastWriteTime | Where-Object {$_.SideIndicator -eq "&lt;="} | ForEach-Object {
      Copy-Item "C:\Source\$($_.name)"  -Destination "C:\TestFolder" -Force -recurse -include "*.txt"
  }
  </code></pre>