Powershell equivalent to copy the Xcopy only updated files that exist in target

可紊 提交于 2019-12-11 02:53:48

问题


In windows batch I would do

xcopy source_spec target_spec /d/u/r/y

/d : more recent
/u : only those that exist in target
/r : ignore the read only flag
/y : don't prompt for overwrite

What's the simplest using the powershell copy-item/copy cmdlet equivalent.

And to the wags - yes I know I can do xcopy in powershell :-)

so in powershell I do:

cmd /c xcopy source_spec target_spec /d/u/r/y

回答1:


No there is no straightforward equivalent without writing few lines of script. Use xcopy or robocopy.



来源:https://stackoverflow.com/questions/7371918/powershell-equivalent-to-copy-the-xcopy-only-updated-files-that-exist-in-target

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!