3

I am trying to copy the folder and rename it.

How to do it with powershell?

Copy-item fails as i am trying to paste it in the same directory.

2 Answers 2

8
Copy-Item Original Original-Copy -recurse

So it copies the contents too.

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

1 Comment

If the folder "Original-Copy" already exists then Copy-Item places a copy of the folder within "Original-Copy" named "Original". Delete any existing "Original-Copy" folders first to prevent this.
3

Just give the destination a new name. This worked for me.

Copy-Item Original Original-Copy

Copied the folder named "Original" to a folder named "Original-Copy".

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.