0

This may be a very ridiculous question but when executing the copy-item command, only the main folder is copied MINUS the contents within. for example I have

\server1\parent\child <<---this folder has items nested within but copy-item only moves the folder, not the items within. I have tried the following 2:

copy-item "\\server1\parent\child -destination "\\server2\parent\child

copy-item "\\server1\parent\child\* -destination "\\server2\parent\child

but again, the first line only moves the folder and the second lines moves folder and items but items are not moved within the folder. I was wanting to keep the folder structure the same as from where I am copying it from. I looked at a few places, including here, and I must be missing something.

Any help would be awesome!

1 Answer 1

0

I found the answer right after I posted the question. I was missing the -recurse option after the \server1\parent\child. The line that now works is

copy-item ''\\Server1\parent\child" -recurse -destination "\\Server1\parent\child"

Thanks Everyone!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.