Does Set-PnPFileCheckedIn.cs support folders ?

Highlighted
Regular Contributor

Hi

 

I have a document which is two folders deep in a document library. When I try and use Set-PnPFileCheckedIn with a Url like "/Documents/Incorporation/Objections/incorporation objection.docx" I get an error " Set-PnPFileCheckedIn : Server relative urls must start with SPWeb.ServerRelativeUrl"  if I add in -Web /sites/board/archives I get the same error.  If I change the -Web parameter to be sites/board/archives I get the error message  "Set-PnPFileCheckedIn : File Not Found."

 

Anybody any ideas ?

 

Thanks

 

Nigel

6 Replies
Highlighted

Try with a Url like:

 

"/sites/board/archives/Documents/Incorporation/Objections/incorporation objection.docx"

 

It's a server relative url that is needed to all except the https://tenant.sharepoint.com bit

 

Highlighted

Hi @Pieter Veenstra

 

I tried that - it came back with :-

 

Set-PnPFileCheckedIn

cmdlet Set-PnPFileCheckedIn at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Url: /sites/board/archives/Documents/Incorporation/Objections/incorporation objection.docx
Set-PnPFileCheckedIn : File Not Found.

 

Regards

 

Nigel

 

 

Highlighted

Hi @Nigel Price,

 

In my dev site /sites/dev

 

in the documetn library I created folder1 in there I created folder 2 and then I created document.docx

 

I manully checked out the document.

 

And then I  tried this:

 

Connect-PnPOnline -Url https://mytenant.sharepoint.com/sites/dev -Credentials $cred

Set-PnPFileCheckedIn -Url "/sites/dev/Shared Documents/folder1/folder2/Document.docx"

 

Are you checking in and out as the same user?

 

 

Highlighted

Hi @Pieter Veenstra

 

Can you try with a space in the folder name ?

 

I have a suspicion that is the problem.

 

Regards

 

Nigel

Highlighted

and / or the filename

Highlighted
Just tested it and I am getting the same issue