开发者

Copy-Item problem with destination

开发者 https://www.devze.com 2023-01-20 08:54 出处:网络
I have two Copy-Item commands Copy-Item \"C:\\Test\\folder1\" \"\\\\remote_machine\\destination\" -Recurse

I have two Copy-Item commands

  1. Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse

  2. Copy-Item "C:\Test\folder2" "\\remote_machine\destination" -Recurse

folder1 and folder2 contain folders and files

Both commands are similar, but I get different results

  1. Copy content of folder1 to destination - OK
  2. Copy folder2 with all content to destination - \remote_machine\destination\folder2 - FAIL

UPDATE: I don't get any error. Problem is about开发者_StackOverflow社区 path to second folder. I want content of both folders in one destination folder.


It's problem with PowerShell - http://groups.google.com/group/microsoft.public.windows.powershell/browse_frm/thread/ae9b8b4424c2af22

Solution for my examples is

  1. Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse
  2. Copy-Item "C:\Test\folder2\*" "\\remote_machine\destination" -Recurse
0

精彩评论

暂无评论...
验证码 换一张
取 消