Jun 16 2017 04:06 AM - edited Jun 16 2017 05:16 AM
I have added custom/OOB web part to an page using: -
Add-PnPWebPartToWebPartPage -ServerRelativePageUrl $pageUrl -Path $webPartPath -ZoneId "wpz" -ZoneIndex 0.
There is no error and the command is getting executed properly. After that I checked web parts on the page using following command: -
Get-PnPWebPart -ServerRelativePageUrl $pageUrl
As per response of above command new web part is added sucessfully on page.
But when I visited the page the web part is not visible there.
Also when I open the page in SharePoint Designer I was able to see web part there.
While adding the web part I have taken care of File Check-in and Check-out.
When I add the same custom/OOB web part through UI after editing the page the web part is visible.
Could any one please let me know why I am not able to see web part on the page which I added through Add-PnPWebPartToWebPartPage.
Jun 16 2017 04:59 AM
have you tried adding ?content=1 to your page url? so that you can check in the web part page maintenance page if the web part is there?
Jun 16 2017 05:15 AM
Yes, I have tried adding ?content=1. Web Part was not there. But when I open the page using SharePoint Designer the web part was there.
Nov 30 2021 07:26 AM
I know this post is some what old, but I am currently also running into this same issue on SP2016, was this ever resolved? Thanks for any assistance.
v/r
JShidell