Replies: 1 comment 1 reply
-
Using Set-PnPPageWebPart after Add-PnPPageWebPart resolved my issue, i made no changes to the $props variable. Would love to know why, if anyone has the details. $page = Get-PnPClientSidePage -Identity "Home"
$isOnPage = $page.Controls | Where-Object { $_.Title -match $handshakeWebPartName }
if ( ($page) -and !($isOnPage) ) {
$component = Add-PnPPageWebPart -Page "Home" -Component $handshakeWebPartName # -WebPartProperties $props -Section 1 -Column 1
Set-PnPPageWebPart -Page "Home" -Identity $component.InstanceID -PropertiesJson $props
Write-Host "Component ID = $($component.InstanceID)"
Write-Host "Component Title = $($component.Title)"
return $page
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm sure i'm missing something, but using Add-PnPPageWebPart seems to work, code executes without complaint, but the page is unchanged? What am I missing?
The code is
The console results look like this:
But the page itself, when viewed in the browser or inspecting the returned object is unchanged.
What step am I missing?
Thanks in advance for any assistance.
Beta Was this translation helpful? Give feedback.
All reactions