So, here goes:
|
1 2 3 4 5 6 7 8 9 10 11 |
Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/ARACHITA1 -Interactive $allItems = Get-PnPListItem -List "LibTestMulti" -FolderServerRelativeUrl "/sites/ARACHITA1/LibtestMulti/Folder1" foreach ($item in $allItems) { if ($item.FileSystemObjectType -eq "File") { Write-Host "Copying file: $($item.FieldValues.FileLeafRef)" -ForegroundColor green Copy-PnPFile -SourceUrl "$($item.FieldValues.FileRef)" -TargetUrl ("/sites/Calendar2405/doclib33/TEST") -Overwrite -Force } } |
So the script will copy the files from /sites/arachita1/LibtestMulti/Folder1 to /sites/Calendar2405/doclib33/Test
Enjoy!

Leave a Reply