title: PowerShell implementation of xcopy
body: <p>Is there a way to replicate an xcopy functional using powershell?</p>
  
  <p>I thought it was an easy question until I tried some cmdlets.</p>
  
  <p>Let's imagine I've got a folder structure like:</p>
  
  <p>src</p>
  
  <p>|-a</p>
  
  <p>|-b</p>
  
  <p>There're files in each folder of course. I need to copy contents of Src to some folder Dst.</p>
  
  <p>With xcopy it'd be like this:</p>
  
  <pre><code>xcopy src dst\ /e /y
  </code></pre>
  
  <p>PS analog would be something like this:</p>
  
  <pre><code>copy-item src dst\ -force -recurse -verbose
  </code></pre>
  
  <p>Works great... the first time. The second time it creates a subfolder dst\src and puts files there!</p>
  
  <p>I can't figure out any easy workaround. Can you?</p>
  
  <p>p.s. I know I can use xcopy in PS.</p>