Forum Discussion
Anonymous
Oct 23, 2018Adding a Page Properties webpart to a modern page using PnP Powershell
Is it possible at the moment to add a Page Properties web part to a modern page using PnP PowerShell? I've managed to get the others working but looks like the latest webpart hasn't been added yet - ...
Anonymous
Nov 16, 2018Thanks, will give that a try later today and let you know. How did you pull the IDs?
Ben Ide
Nov 18, 2018Copper Contributor
I got the field Ids by querying the list and loading the fields property:
context.Load(sitePagesList, l => l.Fields);
Then matching against a list of my chosen field names, something like:
sitePagesList.Fields.FirstOrDefault(x => x.InternalName == columnName ||
x.InternalName == columnName.Replace(" ", "_x0020_") ||
x.Title == columnName);