Forum Discussion
MarÃa José Pedreira
Apr 26, 2017Brass Contributor
Upload Published Files using Add-PnPFile
Hi all, I have to upload a file and next command works fine: Add-PnPFile -Path $file -Folder "/Pages" -Web $subweb -Values @{Title=$subweb.Title} After upload the file, I get information ab...
MarÃa José Pedreira
Apr 26, 2017Brass Contributor
Hi Pieter,
using:
Set-PnPFileCheckedIn -Web $subweb -Url "/Pages/myPage.aspx" -CheckinType MajorCheckin -Comment "Version1.0"
I get the error:
Set-PnPFileCheckedIn : Value does not fall within the expected range.
Apr 26, 2017
I'm quite sure that the Url expects a server relative Url
-Url /sites/site/subweb/Pages/default.aspx
- MarÃa José PedreiraApr 26, 2017Brass Contributor
After trying several posibilities eventually I got it with
Add-PnPPublishingPage -PageName 'MyCustomName'
-Web $subweb
-Title $subweb.Title
-PageTemplateName 'MyCustomLayout'
-Publish- Khalid HajjoujiJul 10, 2018Copper Contributor
Try the "-Checkout" property. For example:
Add-PnPFile -Path ".\dummyPage.aspx" -Folder "Pages" -Checkout:$true -Publish:$true -PublishComment "PnP provisioned page"