A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Dear David,
Thanks for your updates.
I'm afraid that the PnP script may not copy the files if the SourceFolderURL is the root folder of the library.
There may be two workarounds applied to your requirements.
- Put all other folders and files in a folder, define the folder as SourceFolderURL and run the script with SharePoint Online PnP.
- Use Power Automate to copy all folders, files and subfolders in the parent folders and files between libraries in different sites.
For example, you have the following folders and files in Libvrary809 in SearchTest1. Folder1 contains Subfolder1, Subfolder1 contains Document1.docx and you want to copy Folder1 with Subfolder1 and Document1.docx, Folder2 and Document2.docx to NewLibrary0A in Site0111.
You can create the flow as follows.
Condition:
IsFolder: true
Folder path: Libvrary809/
Condition2:
IsFolder: false
Folder path: Libvrary809/
Result:
Thanks for your understanding and have a nice day!
Sincerely,
Cliff | Microsoft Community Moderator
***Note: In the event that you're unable to reply to this thread, please ensure that your Email address is verified in the Community Website by clicking on Your Account Name > "My Profile" > "Edit Profile" > Add your Email Address > tick "Receive email notifications" checkbox > click on "Save". ***