pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

-SkipSourceFolderName not working on Copy-PNPFile #2932

Open MonkeyManvin opened 3 years ago

MonkeyManvin commented 3 years ago

Reporting an Issue

Issue

Expected behavior

When copying a folder from source eg Test1 using the -SkipSourceFolderName switch, the target should just contain the contents of the source folder, not the source folder itself with the contents within.

Actual behavior

The source folder is copied as well as its contents. This happens when copying from a Sharepoint Online site to a site created as part of a Teams. not sure if this is the same across all site collection copies. It appears to work as expected when the source and target are within the same site.

Steps to reproduce behavior

Copy-PnPFile -SourceUrl "library/folder" -TargetUrl "/sites/TeamsName/Shared Documents" -SkipSourceFolderName -Force -IgnoreVersionHistory

Source folder needs some files in it.

Which version of the PnP-PowerShell Cmdlets are you using?

PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

3.25.20

How did you install the PnP-PowerShell Cmdlets?

Installed through the PowerShell Gallery with Install-Module. Using Visual Studio Code to write PS scripts.