Closed raymondlittle100 closed 6 years ago
@wobba Is there a way to use the Add-PnPClientSideWebPart cmdlet as opposed to Add-PnPClientSideText for adding text web-parts to modern SPO pages via PS?
I'd like to be able to set the innerHTML property in the same way I can when doing something like:
Add-PnPClientSideWebPart -Page "SomePage" -DefaultWebPartType List -WebPartProperties $templateWebPartProps
Any ideas?
nvm, looks like I dump HTML into the -Text property!
@patrickabel the text webpart is not a webpart per say - behaves a bit different. And glad you sorted it out. Beware of what you dump and how it possibly can change in edit mode.
Reporting an Issue or Missing Feature
Question
Question
I'm trying to write a script to add web parts to a modern page using 'PnP PowerShell for SharePoint Online'. I have the page creation and section setup done but now I'm trying to add web parts. I'm using 'Add-PnPClientSideWebPart' and this works fine for custom web parts but when trying to add text I can't see how to set the text. I even added the Text web part to the workbench to see if i could see the web part properties but there were none.
My question is can I use the generic 'Add-PnPClientSideWebPart' function or do I have to use the more specific 'Add-PnPClientSideText' function?
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
2.22.1801.0
How did you install the PnP-PowerShell Cmdlets?