0

I am using PowerShell Get-SPOSiteScriptFromWeb and Add-SPOSiteScript etc. I am able to copy links, create lists, etc. But my HomePage webparts/layout is not reflected when I apply the site script and design. I've been looking for solutions for days and I'm getting so tired >_<;

I saw that PNP should be able to do this but my global admin has not given permissions to the new PNP Shell yet in azure.

My desired Layout: desired layout

New Site Layout/Template - looks just like the default layout after applying the new site design script. What am I missing? or doing wrong?

Please help. thank you.

Code Sample:

#Define Parameters
$AdminCenterURL = "https://wafd-admin.sharepoint.com"
$SiteURL = "https://wafd.sharepoint.com/sites/TemplateTest"
$relativeListUrls = ("/Lists/Issues Log", "Lists/Artifacts Checklist")
  
#Connect to SharePoint Online
Connect-SPOService -Url $AdminCenterURL -credential (Get-Credential)

#Get the site schema & add site schema as site script 
 $extracted = Get-SPOSiteScriptFromWeb `
    -WebUrl $SiteURL `
    -IncludeBranding `
    -IncludeTheme `
    -IncludeRegionalSettings `
    -IncludeSiteExternalSharingCapability `
    -IncludeLinksToExportedItems `
    -IncludedLists ($relativeListUrls)
 
 $SiteScript = Add-SPOSiteScript `
    -Title "Mark template site v4" `
    -Description " Attempt 5 ." `
    -Content $extracted

#Create the site design 
$SiteDesign = Add-SPOSiteDesign -Title "Mark Template Site V5" -WebTemplate 64 -SiteScripts $SiteScript.id

write-host(" Mission Complete Yahoo ?"); 

enter image description here

2
  • 1
    Hi @Mark Apolinar, I am currently doing some research on this issue, will let you know as soon as possible.
    – Zella_msft
    May 6, 2022 at 9:39
  • Thank you and appreciate it. May 11, 2022 at 20:43

1 Answer 1

0

It sounds as though what you need to use is a PnP provisioning template, which allows you to define the content and structure of pages as well.

Introducing the PnP provisioning engine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.