Forum Discussion
Kevin_Hoyt
Apr 29, 2019Iron Contributor
Site Scripting creating new lists every time
The documentation says that running site scripts is nondestructive in that if a list already exists the script will skip creating a new one and update the existing list and I could have sworn it was doing that not long ago but in my testing now I am getting a brand new list every time I run my script. It is just appending a number to the end of the internal name and creating a new list. Did something change or is there something I'm doing wrong to cause that?
6 Replies
- Rob EllisBronze ContributorHas the display name of your list been changed since creation?
- Kevin_HoytIron Contributor
Rob EllisNo, I'm working on adding columns and views so as I add them I rerun this script to update the script stored in the tenant. Maybe it makes a difference if I delete the site design and re-add it rather than just updating the script?
$adminSiteUrl = "https://tenant-admin.sharepoint.com"
$siteScriptId = "<guid>"
$siteScriptFile = $PSScriptRoot + "\ConfigurePMOSite.json"$cred = Get-Credential
Connect-SPOService $adminSiteUrl -Credential $credSet-SPOSiteScript -Identity $siteScriptId -Content (Get-Content $siteScriptFile -Raw)- Rob EllisBronze ContributorThe process you are following is the correct one, as I understand it.
Having now made the change to the script - if you run it on a brand new site, then run it a 2nd time - do you get the issue?
(Just trying to confirm whether the issue is the multiple runs, or the script change)