title: Copying subfolders and files, checking "last modified time"
body: <p>I have made a backup script that:</p>
  
  <ol>
  <li>Reads source file paths and destination folder path from an XML file</li>
  <li>Checks if source file and destination path exist (for each file)</li>
  <li>Checks if source file (same name) exists in the target folder</li>
  <li>Checks the last modified date of every source and destination file, if the file exists in the target folder</li>
  <li>Copies source files to the target folder if the file does not already exist, or if the source file is newer than the existing file in the destination folder, otherwise does nothing</li>
  </ol>
  
  <p>This only works on source files, if a source folder is specified in the XML file, only that folder will be copied, and none of its content.</p>
  
  <p>I don't want to use <code>Copy-Item -Recurse</code> because I want to check the last modified date of every item, and if it fails the above conditions I don't want to copy it at all.</p>
  
  <p>This brings me to <code>Get-ChildItem -Recurse</code> to list everything, but I'm having trouble coming up with something that works for this example:</p>
  
  <pre><code>C:\powershell\test\ (XML specified source)
  </code></pre>
  
  <p>Underlying structure:</p>
  
  <pre><code>C:\powershell\test\xmltest2.xml
  C:\powershell\test\test2\xmltest.xml
  C:\powershell\test\test3\test4\xmltest3.xml
  etc.
  </code></pre>
  
  <p>i.e. I want to check every file before copying it but if say a folder has not been modified but a file inside it should be copied it should still work, AND retain the same folder structure.</p>
  
  <p>Any ideas? :)</p>