A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi, @Andreea Ruth Moldovan ,
For saving site as template, try to use the script below. Make sure you have enabled saving site as template before. It works in my lab SharePoint 2019 farm
$WebURL = "http://your-site-collection-URL"
#Get the Web Object
$Web= Get-SPWeb $WebURL
#Variables for Save site as template settings
$TemplateName ="PMO Site Template"
$TemplateTitle ="PMO Project Site Template"
$TemplateDescription ="Site template for PMO project management portal"
#Option to Save with content
$SaveWithContent= 1 #0 otherwise
#Save site as template programmatically with PowerShell
$Web.SaveAsTemplate($TemplateName,$TemplateTitle,$TemplateDescription,$SaveWithContent)
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.