You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running "Invoke-PnPSiteScript" on a site to Update the list there - does not update the list or add the additional column
In fact - the script exits complaining that the "List already Exists"
The script was run once to create the list from the json file.
The json file was then amended to include a brand new column (by extracting from an existing list again using: Get-PnPSiteScriptFromList -List $listName)
The script was then run again on the same site, but giving the output:
This Documentation 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."
Actual behavior
The Output for the "CreateSPList" action is:
ErrorCode : -2130575342 Outcome : 2 OutcomeText : List with name TestList already exists. Target : TargetId : Title : Create or update list "TestList"
Steps to reproduce behavior
Export a List to a json definition using Get-PnPSiteScriptFromList -List $listName > list.json
Create a new list using Invoke-PnPSiteScript -Script list.json
Edit the List (manually) to add a new Column
Repeat the above process to update the list.json, and to update the existing list with the additional column
What is the version of the Cmdlet module you are running?
I have tried with both version 2.12 and the nightly build 2.99.2
Which operating system/environment are you running PnP PowerShell on?
Linux - Powershell version 7.4.4
The text was updated successfully, but these errors were encountered:
I am sorry, but either you are WRONG, or the documentation is WRONG and misleading.
SharePoint site template and site script overview<https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview>
Use SharePoint site scripts and site templates to provide custom configurations to apply when new sites are created.
learn.microsoft.com
"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."
James
Reporting an Issue or Missing Feature
Running "Invoke-PnPSiteScript" on a site to Update the list there - does not update the list or add the additional column
In fact - the script exits complaining that the "List already Exists"
The script was run once to create the list from the json file.
The json file was then amended to include a brand new column (by extracting from an existing list again using: Get-PnPSiteScriptFromList -List $listName)
The script was then run again on the same site, but giving the output:
Expected behavior
I expect the List schema to be Updated, and the new column added, as per the documentation here:
https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
This Documentation 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."
Actual behavior
The Output for the "CreateSPList" action is:
ErrorCode : -2130575342 Outcome : 2 OutcomeText : List with name TestList already exists. Target : TargetId : Title : Create or update list "TestList"
Steps to reproduce behavior
Export a List to a json definition using
Get-PnPSiteScriptFromList -List $listName > list.json
Create a new list using
Invoke-PnPSiteScript -Script list.json
Edit the List (manually) to add a new Column
Repeat the above process to update the list.json, and to update the existing list with the additional column
What is the version of the Cmdlet module you are running?
I have tried with both version 2.12 and the nightly build 2.99.2
Which operating system/environment are you running PnP PowerShell on?
Linux - Powershell version 7.4.4
The text was updated successfully, but these errors were encountered: