iJK
iJK

Reputation: 4775

Using Set-PnPListItem with a "Publishing Image" type

I am on Powershell Version Major 5, Minor 1, Build 14393, Revision 2636

I have Microsoft.Online.SharePoint.Powershell version 16

I am using SharePoint PnpPowershellOnline version 3.13.19

I am using the Add-PnpPublishingPage to create n number of pages in the document library.

Then I get a list of pages via Get-PnpListItem and I set the fields for that page via Set-PnpListItem and passing a hashtable to the Values attribute

All of the fields on the page are set except a field with type PublishingImage.

Set-PnPListItem -List "Pages" -Identity 2 -Values @{"PublishingPageImage"="imgURL"}

Does not give you an error but the image URL is not set either.

Upvotes: 1

Views: 654

Answers (1)

Lee
Lee

Reputation: 5493

Sample test script, you could try it.

Set-PnPListItem -List "Pages" -Identity 2 -Values @{"PublishingPageImage"='<img src="/sites/lee/PublishingImages/panda.jpg">'}

Upvotes: 1

Related Questions