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

[BUG] Copy-PnPFile - Microsoft.SharePoint.Client.UnknownError #4731

Open
1 of 6 tasks
YuriySamorodov opened this issue Feb 7, 2025 · 1 comment
Open
1 of 6 tasks
Labels
bug Something isn't working

Comments

@YuriySamorodov
Copy link
Contributor

YuriySamorodov commented Feb 7, 2025

Reporting an Issue or Missing Feature

I am encountering an error when using the Copy-PnPFile cmdlet in PnP PowerShell. The error message indicates an "Unknown Error" with the code -1, Microsoft.SharePoint.Client.UnknownError.

Expected behavior

When executing the Copy-PnPFile cmdlet, I expect the specified file to be successfully copied from the source location to the destination location within SharePoint.

Actual behavior

Instead of the file being copied, I receive the following error message:

{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.UnknownError","message":{"lang":"en-US","value":"Unknown Error"}}}

Image

Steps to reproduce behavior

  1. Connect to the source SharePoint site using Connect-PnPOnline.
  2. Make sure folder creation is enabled for the target library
Set-PnPList -Identity Documents -EnableFolderCreation:$true
  1. Connect to the target SharePoint site using Connect-PnPOnline.
  2. Execute the Copy-PnPFile cmdlet with the appropriate source and destination URLs.Example script:
Connect-PnPOnline -Url "https://your-sharepoint-site-url" -Credentials (Get-Credential)
Copy-PnPFile -SourceUrl "/sites/source-site/Documents/TestFolder" -TargetUrl "/sites/destination-site/Documents"

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

To retrieve the version of the PnP PowerShell module, execute the following command:

PnP.PowerShell 2.99.128

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@YuriySamorodov YuriySamorodov added the bug Something isn't working label Feb 7, 2025
@YuriySamorodov YuriySamorodov changed the title [BUG] [BUG] Copy-PnPFile - Microsoft.SharePoint.Client.UnknownError Feb 7, 2025
@maaanuuueeel
Copy link

I have the same issue. Copy-PNPFile and and Copy-PNPFolder results in the same error.
single files can be copied without error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants