pnp / PnP-PowerShell

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

Add-PnpFile Fails To Move File To SharePoint Folder #1631

Open jason5969 opened 6 years ago

jason5969 commented 6 years ago

Please confirm what it is that your reporting: 1) Add-PnpFile without -Publish switch appears to work but the file does not appear in the specified SharePoint folder. 2) Add-PnPfile with the -Publish swtich renders an error: Add-PnPFile : The object specified does not belong to a list. At line:1 char:1

Expected behavior

Please describe what output you expect to see from PnP-PowerShell Cmdlets Add-PnPfile should create a file in the SharePoint folder as specified in the command.

Actual behavior

Please describe what you see instead. Please provide samples of HTML output or screenshots image

Steps to reproduce behavior

Please include complete code samples in-line or linked from gists

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

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

(you can retrieve this by executing Get-Module -Name *pnppowershell* -ListAvailable)

How did you install the PnP-PowerShell Cmdlets?

ianbruckner commented 5 years ago

same here.

lhlindsay commented 4 years ago

I am having the exact problem as well. Any help?

ChrisRomp commented 4 years ago

@jason5969 For Connect-PnpOnline use the -Url for your site collection, e.g. Connect-PnpOnline -Url https://yourtenant.sharepoint.com/sites/yourSiteCollection.

Then have your -Folder parameter be relative to that site collection, Shared%20Documents/General.

I agree it's a little weird the file gets uploaded.... somewhere?

Side-note also, @jason5969, you should consider redacting more information from your screenshot, like server names in RDCMan (and even your tenant name).