Powershell等效于复制Xcopy中仅存在于目标中的更新文件

Pre*_*gha 2 powershell xcopy

在windows批处理中,我会这样做

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
Run Code Online (Sandbox Code Playgroud)

什么是最简单的使用powershell copy-item/copy cmdlet等价物.

对于摇摆 - 是的,我知道我可以在powershell中进行xcopy :-)

所以在powershell我做:

cmd /c xcopy source_spec target_spec /d/u/r/y
Run Code Online (Sandbox Code Playgroud)

man*_*lds 5

没有写几行脚本就没有直截了当的等价物.使用xcopy或robocopy.