Problem copying to destination

I have two Copy-Item commands

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

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

folder1 and folder2 contain folders and files

Both teams are similar, but I get different results

  • Copy contents of folder1 to destination - OK
  • Copy folder2 with all content to destination - \ remote_machine \ destination \ folder2 - FAIL

UPDATE: I am not getting any errors. The problem is the path to the second folder. I want the contents of both folders in the same destination folder.

+1
source share
1 answer

PowerShell issue - http://groups.google.com/group/microsoft.public.windows.powershell/browse_frm/thread/ae9b8b4424c2af22

The solution for my examples is

  • Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse
  • Copy-Item "C:\Test\folder2\*" "\\remote_machine\destination" -Recurse
+3
source

Source: https://habr.com/ru/post/900071/


All Articles