title: Copy a list of files to a directory
body: <p>There is a folder that contains a lot of files. Only some of the files needs to be copied to a different folder. There is a list that contains the files that need to be copied.</p>
  
  <p>I tried to use copy-item, but because the target subfolder does not exist an exception gets thrown "could not find a part of the path”</p>
  
  <p>Is there an easy way to fix this?</p>
  
  <pre><code>$targetFolderName = "C:\temp\source"
  $sourceFolderName = "C:\temp\target"
  
  $imagesList = (
  "C:\temp\source/en/headers/test1.png",
  "C:\temp\source/fr/headers/test2png"
   )
  
  
  foreach ($itemToCopy in $imagesList)
  {
      $targetPathAndFile =  $itemToCopy.Replace( $sourceFolderName , $targetFolderName ) 
      Copy-Item -Path $itemToCopy -Destination   $targetPathAndFile 
  }
  </code></pre>