Forum Discussion
Can PowerShell be used to copy SPO Site (created from a Group)?
DanielaH Site "templating" can be done in a couple of ways for modern SharePoint. The first being, using Site Designs and Site Scripts to help provision out some default structures to your new sites that get created. These work as remote provisioning that run *after* a site is created. So imagine, creating a new site and subsequently a process running to apply customizations to the new site.
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
However, these are fairly limited in what you are looking for. You'll likely want to leverage Site Designs + PnP Templates to help provision out template sites in your environment. Have a look at this documentation on the architecture and how this would be set up.
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-pnp-provisioning
Alternatively, you could use PnP PowerShell Provisioning to apply a template to an existing site as well. https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/apply-pnpprovisioningtemplate?view=sharepoint-ps