title: Get file list with Robocopy
body: <p>I'm trying to see if a solution with Robocopy could be faster than using the <code>Get-ChildItem</code> for getting a list of files that are inside a given folder (and subfolders...).</p>
  
  <p>In my code I'm using the <code>Get-ChildItem</code> cmdlet to get a list of all files inside a specific folder in order to loop on each of these file:</p>
  
  <pre><code>$files = Get-ChildItem "C:\aaa" -Recurse | where {! $_.PIsContainer} # ! because I don't want to list folders
  foreach ($file in $files){
  ...
  }
  </code></pre>
  
  <p>Now, I have the robocopy command to get a list of all files, however, the output of robocopy is a string.</p>
  
  <pre><code>[string]$result = robocopy "C:\aaa" NULL /l /s /ndl /xx /nc /ns /njh /njs /fp
  </code></pre>
  
  <p>So, how can I use the output from the robocopy command to loop on each file (similar to what was done with <code>Get-ChildItem</code>?</p>