Mar 28 2017 08:01 AM - edited Mar 28 2017 08:10 AM
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
Mar 28 2017 08:10 AM
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
Mar 28 2017 08:14 AM
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
Mar 28 2017 08:46 AM
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?
Mar 28 2017 10:05 AM
Can you try with a space in the folder name ?
I have a suspicion that is the problem.
Regards
Nigel
Mar 28 2017 10:34 AM