Quantcast
Channel: PowerShell implementation of xcopy - Stack Overflow
Viewing all articles
Browse latest Browse all 3

PowerShell implementation of xcopy

$
0
0

Is there a way to replicate an xcopy functional using powershell?

I thought it was an easy question until I tried some cmdlets.

Let's imagine I've got a folder structure like:

src

|-a

|-b

There're files in each folder of course. I need to copy contents of Src to some folder Dst.

With xcopy it'd be like this:

xcopy src dst\ /e /y

PS analog would be something like this:

copy-item src dst\ -force -recurse -verbose

Works great... the first time. The second time it creates a subfolder dst\src and puts files there!

I can't figure out any easy workaround. Can you?

p.s. I know I can use xcopy in PS.


Viewing all articles
Browse latest Browse all 3

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>