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 #1110

Open
1 of 6 tasks
YuriySamorodov opened this issue Feb 17, 2025 · 0 comments
Open
1 of 6 tasks

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

YuriySamorodov opened this issue Feb 17, 2025 · 0 comments

Comments

@YuriySamorodov
Copy link

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

Related ticket:

pnp/powershell#4731

@YuriySamorodov YuriySamorodov changed the title [BUG] Copy-PnPFile - Microsoft.SharePoint.Client.UnknownError # [BUG] Copy-PnPFile - Microsoft.SharePoint.Client.UnknownError Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant