title: Copy files in PowerShell too slow
body: <p>Good day, all. New member here and relatively new to PowerShell so I'm having trouble figuring this one out. I have searched for 2 days now but haven't found anything that quite suits my needs.</p>
  
  <p>I need to copy folders created on the current date to another location using mapped drives. These folders live under 5 other folders, based on language.</p>
  
  <p>Folder1\Folder2\Folder3\Folder4\chs, enu, jpn, kor, tha</p>
  
  <p>The folders to be copied all start with the same letters followed by numbers - abc123456789_111. With the following script, I don't need to worry about folder names because only the folder I need will have the current date.</p>
  
  <p>The folders that the abc* folders live in have about 35k files and over 1500 folders each.</p>
  
  <p>I have gotten all of this to work using Get-ChildItem but it is so slow that the developer could manually copy the files by the time the script completes. Here is my script:</p>
  
  <pre><code>GCI -Path $SrcPath -Recurse | 
  Where {$_.LastWriteTime -ge (Get-Date).Date} |
      Copy -Destination  {
          if ($_.PSIsContainer) {
              Join-Path $DestPath $_.Parent.FullName.Substring($SrcPath.length)
          } else {
              Join-Path $DestPath $_.FullName.Substring($SrcPath.length)
          }
      } -Force -Recurse
  </code></pre>
  
  <p>(This only copies to one destination folder at the moment.)</p>
  
  <p>I have also been looking into using <code>cmd /c dir</code> and <code>cmd /c forfiles</code> but haven't been able to work it out. Dir will list the folders but not by date. Forfiles has turned out to be pretty slow, too.</p>
  
  <p>I'm not a developer but I'm trying to learn as much as possible. Any help/suggestions are greatly appreciated.</p>