pnpframework
pnpframework copied to clipboard
Invoke-PnPSiteScript does not add List Columns to existing list
I provisioned a Site and Lists from a Site Script.
I then amended the Site Script to add another field to one of the lists.
I then ran the Invoke-PnPSiteScript again, expecting the new column to be created.
It was not.
The documentation here: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
Clearly states: "Site scripts can be run again on the same site after provisioning. Site scripts are non-destructive, so when they run again, they ensure that the site matches the configuration in the script.
For example, if the site already has a list with the same name that the site script is creating, the site script will only add missing fields to the existing list."
The Create List Step outputted: ErrorCode : 0 Outcome : 0 OutcomeText : Target : ########## (redacted) TargetId : 92509bd0-1a58-4e7f-b20c-3af7e3ab6abe Title : Create or update list "Contacts"
- I notice that the step is specifically named "Create or Update list..."
The Output of the SiteScript Step for adding the additional field looks like this:
ErrorCode : 0 Outcome : 0 OutcomeText : Target : TargetId : Title : Add list column "TESTAddColumn"
Notice that NO error was given, but also that the "Outcome" = 0. Again, The Column was NOT created in the list