Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy-Item should support a recursive flag for child items #780

Closed
MichaelBosch opened this issue Jan 6, 2017 · 3 comments
Closed

Copy-Item should support a recursive flag for child items #780

MichaelBosch opened this issue Jan 6, 2017 · 3 comments

Comments

@MichaelBosch
Copy link

It should be possible to execute something like this:
copy-item "master_legacy:\media library\MySite" "master:\media library" -TransferOptions 0 -Recursive 1

This would create the MySite folder in the destination and then loop through all the children of MySite and create those items as well including subfolders and other child items.

Currently, this will just create an empty folder named MySite on the target.

@michaellwest
Copy link
Member

@MichaelBosch
With the following script, I was able to make this happen:

# I manually created Social2 in this example
Copy-Item -Path "master:\media library\Images\Social\Connector" -Destination "master:\media library\Images\Social2" -Recurse

image

Is this what you are trying to achieve?

@michaellwest michaellwest self-assigned this Jan 8, 2017
@michaellwest michaellwest added area-scripts question Need help solving a problem. labels Jan 8, 2017
@michaellwest
Copy link
Member

Do note that -TransferOptions is a dynamic parameter only on the CmsItemProvider while the -Recurse switch is available by default.

@MichaelBosch
Copy link
Author

Yep. Got it working. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants