<?xml version="1.0" encoding="UTF-8" ?><!-- generator=Zoho Sites --><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><atom:link href="https://www.bauerautomate.com/blogs/tag/PowerShell/feed" rel="self" type="application/rss+xml"/><title>Bauer Automate - Blog #PowerShell</title><description>Bauer Automate - Blog #PowerShell</description><link>https://www.bauerautomate.com/blogs/tag/PowerShell</link><lastBuildDate>Wed, 29 Apr 2026 17:02:41 -0700</lastBuildDate><generator>http://zoho.com/sites/</generator><item><title><![CDATA[Using PowerShell to Save or Clone an Existing SharePoint Online Site to Publish a the Global Template to the "From Your Organization" Menu ]]></title><link>https://www.bauerautomate.com/blogs/post/powershell-clone-site</link><description><![CDATA[<img align="left" hspace="5" src="https://www.bauerautomate.com/USINGP-2.PNG"/>Publishing a site template to the From Your Organization menu gives every site creator an on-brand starting point. We share the PowerShell scripts we use to save or clone a SharePoint Online site as a global template, with cmdlets and lessons from enterprise rollouts.]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_FfFMrWGET8yN05GWfkQI6A" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_-d7oMZ830gZGy8dslLBuBg" data-element-type="row" class="zprow zprow-container zpalign-items-flex-start zpjustify-content-flex-start zpdefault-section zpdefault-section-bg " data-equal-column="false"><style type="text/css"></style><div data-element-id="elm_LSAuCr2kiKkLLFLKzsOX3Q" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- zpdefault-section zpdefault-section-bg "><style type="text/css"></style><div data-element-id="elm_if4lOijTEc7rMzGdpLEMNA" data-element-type="video" class="zpelement zpelem-video "><style type="text/css"> @media (max-width: 767px) { [data-element-id="elm_if4lOijTEc7rMzGdpLEMNA"].zpelem-video iframe.zpvideo{ width:560px !important; height:315px !important; } } @media all and (min-width: 768px) and (max-width:991px){ [data-element-id="elm_if4lOijTEc7rMzGdpLEMNA"].zpelem-video iframe.zpvideo{ width:560px !important; height:315px !important; } } </style><div class="zpvideo-container zpiframe-align-center zpiframe-mobile-align-center zpiframe-tablet-align-center"><iframe class="zpvideo " width="800" height="450" src="https://www.youtube.com/embed/D1ldOGlRO3o?si=DxN_OKxUe8VgNU05" frameborder="0" allowfullscreen></iframe></div>
</div><div data-element-id="elm_8n6SvUIg9hAkzor81YA48w" data-element-type="text" class="zpelement zpelem-text "><style></style><div class="zptext zptext-align-left zptext-align-mobile-left zptext-align-tablet-left " data-editor="true"><p></p><div><p>SharePoint Online is a powerful tool for creating intranet sites, and it's even more powerful when you can create and use custom templates to streamline the process for multiple projects or clients. Unfortunately, creating a template from an existing SharePoint Online site can be a difficult task, especially for non-programmers.</p><p><br/></p><p>In the past, creating a template was as simple as a&nbsp;<a href="https://support.microsoft.com/en-us/office/create-and-use-site-templates-in-sharepoint-server-versions-60371b0f-00e0-4c49-a844-34759ebdd989#:%7E:text=Save%20Site%20as%20Template%20in%20SharePoint%20Server%202013%2CInclude%20Content%20check%20box.%20...%20.%20See%20More." target="_blank" rel="">few clicks in SharePoint classic</a>, but with the new SharePoint Online, it's not so easy anymore. I've tried various methods, such as using flows and http requests, but I've found that the best way to clone a site multiple times is by using PowerShell to export the existing site and create a template from it.</p><p>I created a simple script based on&nbsp;<a href="https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/get-spositescriptfromweb?view=sharepoint-ps#example-1" target="_blank" rel="">Microsoft's documentation</a>, and even corrected a typo in the documentation regarding spaces in list and library names.&nbsp;<a href="https://github.com/MicrosoftDocs/OfficeDocs-SharePoint-PowerShell/issues/355" target="_blank" rel="">I even corrected a typo on the docs</a>! The internal names, such as &quot;Shared%20Documents&quot; had to be used instead of &quot;Shared Documents&quot;.</p><p><br/></p><p>In the upcoming Part 2 of this post, I will review the entire workflow, from a SharePoint list for projects, to a Power Automate flow that creates the site, provides permissions, applies the template, copies over some template files, and even applies customizations to the home page.</p><p><br/></p><p>In summary, publishing an existing site as a template using PowerShell is the best way to clone a site multiple times. It's a little technical, but with the right script and a little bit of tweaking, you can make this process a lot more manageable.</p><p><br/></p><p><span>Before proceeding, make sure to&nbsp;<a href="https://learn.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online" target="_blank" rel="">install the SharePoint Online Management Shell</a>. The script I've provided includes a check and installation for the module, but I recommend installing it beforehand.&nbsp;</span><br/></p><p><span><br/></span></p><p><span>Open PowerShell as administrator and try my sample code below.&nbsp;Adapting the&nbsp;</span><a href="https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/get-spositescriptfromweb?view=sharepoint-ps#example-1" target="_blank" rel="">sample script&nbsp;</a><span>with some parameters and handling the module installation, we can use the following:</span></p></div><p></p></div>
</div><div data-element-id="elm_-A2ZSRovhsJTPdyKId0WGQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_-A2ZSRovhsJTPdyKId0WGQ"].zpelem-text { background-color:#f5e1f6; background-image:unset; } </style><div class="zptext zptext-align-left zptext-align-mobile-left zptext-align-tablet-left " data-editor="true"><p></p><div></div><p></p><div><div><div><span style="font-style:italic;font-size:12px;"># install the module if you don't already have it</span></div><span style="font-size:12px;"><div><span style="font-style:italic;">&nbsp;if(</span></div><div><span style="font-style:italic;">-not (</span></div><div><span style="font-style:italic;">Get-Module Microsoft.Online.SharePoint.PowerShell -ListAvailable)){</span></div><div><span style="font-style:italic;">&nbsp;Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser -Force</span></div><div><span style="font-style:italic;">&nbsp;}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;">&nbsp;# Choices for operations, set to either $true or $false</span><br/></div><div><span style="font-style:italic;">&nbsp;$exportFromWeb = $true</span></div><div><span style="font-style:italic;">&nbsp;$exportBackupFile = $true</span></div><div><span style="font-style:italic;">&nbsp;$createGlobalTemplate = $true</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;">&nbsp;# SharePoint base URL</span><br/></div><div><span style="font-style:italic;">&nbsp;$baseURL = &quot;ryleybauer&quot;</span></div><div><span style="font-style:italic;">&nbsp;$companyDisplayName = &quot;Bauer Automate&quot;</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;">&nbsp;# Edit these parameters to define your template</span><br/></div><div><span style="font-style:italic;">&nbsp;$newSiteTitle = &quot;Quick Project Template&quot;</span></div><div><span style="font-style:italic;">&nbsp;$shortName = &quot;Projects&quot;</span></div><div><span style="font-style:italic;"><br/></span></div><div><span style="font-style:italic;">&nbsp;# These variables are generated from the parameters above</span></div><div><span style="font-style:italic;">&nbsp;$adminURL = ' https://' + $baseURL + '-admin.sharepoint.com'</span></div><div><span style="font-style:italic;">&nbsp;$siteURL = 'https://' + $baseURL + '.sharepoint.com/sites/' + $shortName</span></div><div><span style="font-style:italic;">&nbsp;$outFolder = $env:USERPROFILE + '\Downloads\' + $newSiteTitle + ' \ '</span></div><div><span style="font-style:italic;">&nbsp;$outFile = $outFolder + $newSiteTitle + '.txt '</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Select Source Data</span><br/></div><div><span style="font-style:italic;">&nbsp;$lists = &quot;Shared%20Documents&quot;, &quot;SitePages&quot;, &quot;Lists/Losses&quot;, &quot;Lists/Projects%20List&quot;</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Connect to SharePoint Online</span><br/></div><div><span style="font-style:italic;">Connect-SPOService -Url $adminURL</span></div><div><br/></div><div><span style="font-style:italic;"># Generate Script from existing site</span></div><div><span style="font-style:italic;">if ($exportFromWeb){</span></div><div><span style="font-style:italic;">&nbsp; &nbsp;$sourceSiteScript = Get-SPOSiteScriptFromWeb -WebUrl $siteURL -IncludeLinksToExportedItems -IncludedLists ($lists)</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Optionally create a backup file in the user' s documents folder</span><br/></div><div><span style="font-style:italic;">if ($exportBackupFile) {</span></div><div><span style="font-style:italic;">&nbsp; &nbsp;New-Item -Path $outFolder -ItemType Directory</span></div><div><span style="font-style:italic;">&nbsp; &nbsp;$sourceSiteScript | Out-File -filepath $outFile</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Optionally publish as global template and site design</span><br/></div><div><span style="font-style:italic;">if ($createGlobalTemplate) {</span></div><div><span style="font-style:italic;">&nbsp; &nbsp;$SiteScript = Add-SPOSiteScript -Title $newSiteTitle -Content $sourceSiteScript</span></div><div><span style="font-style:italic;">&nbsp; &nbsp;$SiteDesign = Add-SPOSiteDesign -Title $newSiteTitle -WebTemplate 64 -SiteScripts $SiteScript.Id</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Get site template list to show the ID of the newly created template and confirm it was successful</span><br/></div><div><span style="font-style:italic;">&nbsp; &nbsp;Get-SPOSiteDesign</span></div></span></div></div></div>
</div><div data-element-id="elm_6z9X39m4G3Y0R7lxcoKUHg" data-element-type="text" class="zpelement zpelem-text "><style></style><div class="zptext zptext-align-left zptext-align-mobile-left zptext-align-tablet-left " data-editor="true"><p></p><div><p></p><div><div><p>When I first started working with SharePoint Site Designs and Site Scripts, I hadn't used them before and wasn't familiar with their structure. However, I found a great resource in DevFacto's blog post on&nbsp;<a href="https://www.devfacto.com/blog/sharepoint-site-designs-site-scripts" target="_blank" rel="">Getting Started with SharePoint Site Designs and Site Scripts</a>. It helped me understand the anatomy of a site script, which was especially helpful when I needed to split my template file...</p><div><div style="text-align:center;">...</div><div style="text-align:center;">I didn't want to split the template file</div><p style="text-align:center;">...</p></div><p>I initially didn't want to split the template file, but I learned that&nbsp;<span style="font-weight:bold;">site scripts are limited to 100,000 characters</span>. My site had multiple lists and libraries with lots of columns and formatting, so I realized that I had more work ahead of me. Excited for the challenge, I decided to split my file by list and library. This way, it would be more modular for future use and each list/library file could be used individually in a new template if needed. If your template is simple and the file is less than 100,000 characters, then you can skip the next section where I discuss splitting the file.</p><p>Reading DevFacto's&nbsp;<a href="https://www.devfacto.com/blog/sharepoint-site-designs-site-scripts" target="_blank" rel="">post</a>&nbsp;was particularly helpful as it gave me a better understanding of the structure of the site script. The&nbsp;<a href="https://www.devfacto.com/blog/sharepoint-site-designs-site-scripts" target="_blank" rel="">post</a>&nbsp;does a great job of outlining the basic structure of the script that I had to use for each file:</p><div style="text-align:center;"><img src="/Sat%20Jan%2014%202023-1.png"/></div><div style="text-align:center;"><img src="/Sat%20Jan%2014%202023-1.png" alt="" style="width:236px;"/></div><div style="text-align:left;">&nbsp;The structure of the script helped me to split my file by list and library which made it more modular for future use. My template site had 3 libraries and 7 lists, so I created 10 files. Each file had the same structure and looked something like this:</div></div><div style="text-align:center;"><img src="/Sat%20Jan%2014%202023-2.png"/></div><div style="text-align:left;"><img src="/Sat%20Jan%2014%202023-2.png" alt=""/><br/></div><div><span><br/></span></div><div><span>My template site had 3 libraries and 7 lists, so I had created 10 files. If you opened the files, each of them looked basically like this:&nbsp;</span></div></div><p><span></span></p></div><p></p></div>
</div><div data-element-id="elm_H7qYMJJlggysYndpMRzZKA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_H7qYMJJlggysYndpMRzZKA"].zpelem-text { background-color:#f5e1f6; background-image:unset; } </style><div class="zptext zptext-align-left zptext-align-mobile-left zptext-align-tablet-left " data-editor="true"><p></p><div></div><p></p><div><div><span style="font-style:italic;font-size:10px;"></span></div><div><div></div><div><div><div><span style="font-style:italic;font-size:12px;">{</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &quot;$schema&quot;: &quot;schema.json&quot;,</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &quot;actions&quot;: [{</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;verb&quot;: &quot;createSPList&quot;,</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;listName&quot;: &quot;Shared Documents&quot;,</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;templateType&quot;: 101,</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;subactions&quot;: [{</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;verb&quot;: &quot;setDescription&quot;,</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;description&quot;: &quot;Project team can use this Documents Library to store deliverable documents.&quot;</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div><span style="font-style:italic;font-size:12px;">//EXTRA STEPS HERE</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; ],</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &quot;bindata&quot;: {},</span></div><div><span style="font-style:italic;font-size:12px;">&nbsp; &nbsp; &quot;version&quot;: 1</span></div><div><span style="font-style:italic;font-size:12px;">};</span></div></div></div><div></div></div><span style="font-size:10px;"><div><span style="font-style:italic;"></span></div></span></div></div>
</div><div data-element-id="elm_vGeKIA2Tqq5icrlOu2v-wA" data-element-type="text" class="zpelement zpelem-text "><style></style><div class="zptext zptext-align-left zptext-align-mobile-left zptext-align-tablet-left " data-editor="true"><p></p><div><p></p><div><div><p></p></div><div><div><div><p>Once we put all of that together, and understand the anatomy of a site script, we can clone very complex site templates.</p><p>If you take the original script from above and add a few more parameters to check if the script should import one or more files instead, you get the following:</p></div></div><div><div><div><div><div></div></div></div></div></div></div><div><span></span></div></div><p><span></span></p></div><p></p></div>
</div><div data-element-id="elm_2Q0034Eudo42mhT2X101iw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_2Q0034Eudo42mhT2X101iw"].zpelem-text { background-color:#f5e1f6; background-image:unset; } </style><div class="zptext zptext-align-left zptext-align-mobile-left zptext-align-tablet-left " data-editor="true"><p></p><div></div><p></p><div><div><span style="font-style:italic;font-size:10px;"></span></div><div><div></div><div><div><span style="font-style:italic;font-size:12px;"></span></div><div><div><div><div><span style="font-style:italic;font-size:14px;"># install the module if you don 't already have it</span></div><div><span style="font-style:italic;font-size:14px;">if (</span></div><div><span style="font-style:italic;font-size:14px;">&nbsp; -not (</span></div><div><span style="font-style:italic;font-size:14px;">&nbsp; &nbsp; Get-Module Microsoft.Online.SharePoint.PowerShell -ListAvailable</span></div><div><span style="font-style:italic;font-size:14px;">&nbsp; )</span></div><div><span style="font-style:italic;font-size:14px;">) {</span></div><div><span style="font-style:italic;font-size:14px;">&nbsp; Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser -Force</span></div><div><span style="font-style:italic;font-size:14px;">}</span></div><div><br/></div><div><span style="font-style:italic;font-size:14px;"># Choices for operations, set to either $true or $false</span></div><div><span style="font-style:italic;font-size:14px;">$exportFromWeb = $true</span></div><div><span style="font-style:italic;font-size:14px;">$importFromFile = $false</span></div><div><span style="font-style:italic;font-size:14px;">$importFromMultipleFiles = $false</span></div><div><span style="font-style:italic;font-size:14px;">$exportBackupFile = $false</span></div><div><span style="font-style:italic;font-size:14px;">$createGlobalTemplate = $false</span></div><div><br/></div><div><span style="font-style:italic;font-size:14px;"># SharePoint base URL</span></div><div><span style="font-style:italic;font-size:14px;">$baseURL = &quot;ryleybauer&quot;</span></div><div><span style="font-style:italic;font-size:14px;">$companyDisplayName = &quot;Bauer Automate&quot;</span></div><span style="font-size:14px;"><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Edit these parameters to define your template</span><br/></div><div><span style="font-style:italic;">$newSiteTitle = &quot;Project Template&quot;</span></div><div><br/></div><div><span style="font-style:italic;"># Select your existing site. The short name is the URL section after &quot;https://bauerautomate.sharepoint.com/sites/SHORTNAME&quot;&nbsp;</span></div><div><span style="font-style:italic;">$existingSiteShortName = &quot;Projects&quot;</span></div><div><br/></div><div><span style="font-style:italic;"># These variables are generated from the parameters above</span></div><div><span style="font-style:italic;">$adminURL = ' https://' + $baseURL + '-admin.sharepoint.com'</span></div><div><span style="font-style:italic;">$siteURL = 'https://' + $baseURL + '.sharepoint.com/sites/' + $existingSiteShortName</span></div><div><span style="font-style:italic;">$outFolder = $env:USERPROFILE + '\Downloads\' + $newSiteTitle + ' \ '</span></div><div><span style="font-style:italic;">$outFile = $outFolder + $newSiteTitle + '.txt '</span></div><div><br/></div><div><span style="font-style:italic;"># Select Source Data</span></div><div><span style="font-style:italic;">$lists = &quot;Shared%20Documents&quot;,&quot;SitePages&quot;,&quot;Lists/Losses&quot;,&quot;Lists/Projects%20List&quot;</span></div><div><br/></div><div><span style="font-style:italic;"># Generate a name for each script - same as above - add as many as needed to match above</span></div><div><span style="font-style:italic;">$inFile1Name = $newSiteTitle + &quot; - Projects&quot;</span></div><div><span style="font-style:italic;">$inFile2Name = $newSiteTitle + &quot; - Documents&quot;</span></div><div><span style="font-style:italic;">$inFile3Name = $newSiteTitle + &quot; - SitePages&quot;</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Input files from existing template that was split into multiple files - add as many as needed, and I recommend 1 per list/library to keep it modular</span><br/></div><div><span style="font-style:italic;">$inFile1 = $outFolder + ' \' + $inFile1Name + '.txt '</span></div><div><span style="font-style:italic;">$inFile2 = $outFolder + ' \' + $inFile2Name + '.txt '</span></div><div><span style="font-style:italic;">$inFile3 = $outFolder + ' \' + $inFile3Name + '.txt '</span></div><div><br/></div><div><span style="font-style:italic;"># Connect to SharePoint Online</span></div><div><span style="font-style:italic;">Connect-SPOService -Url $adminURL</span></div><div><br/></div><div><span style="font-style:italic;"># Generate Script from existing site</span></div><div><span style="font-style:italic;">if ($exportFromWeb) {</span></div><div><span style="font-style:italic;">&nbsp; $sourceSiteScript = Get-SPOSiteScriptFromWeb -WebUrl $siteURL -IncludeLinksToExportedItems -IncludedLists ($lists)</span></div><div><span style="font-style:italic;">}</span></div><div><br/></div><div><span style="font-style:italic;"># Apply Script from existing single file</span></div><div><span style="font-style:italic;">if ($importFromFile) {</span></div><div><span style="font-style:italic;">&nbsp; [string]$sourceSiteScript = Get-Content $inFile1</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Optionally create a backup file in the user' s documents folder</span><br/></div><div><span style="font-style:italic;">if ($exportBackupFile) {</span></div><div><span style="font-style:italic;">&nbsp; New-Item -Path $outFolder -ItemType Directory</span></div><div><span style="font-style:italic;">&nbsp; $sourceSiteScript | Out- File - filepath $outFile</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Optionally publish as global template and site design from single file</span><br/></div><div><span style="font-style:italic;">if ($createGlobalTemplate -and -not $importFromMultipleFiles) {</span></div><div><span style="font-style:italic;">&nbsp; $SiteScript = Add -SPOSiteScript -Title $newSiteTitle -Content $sourceSiteScript</span></div><div><span style="font-style:italic;">&nbsp; $SiteDesign = Add -SPOSiteDesign -Title $newSiteTitle -WebTemplate 64 -SiteScripts $SiteScript.Id</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Apply Script from existing multiple files - add as many as needed</span><br/></div><div><span style="font-style:italic;">if ($importFromMultipleFiles) {</span></div><div><span style="font-style:italic;">&nbsp; [string]$sourceSiteScript1 = Get -Content $inFile1</span></div><div><span style="font-style:italic;">&nbsp; [string]$sourceSiteScript2 = Get -Content $inFile2</span></div><div><span style="font-style:italic;">&nbsp; [string]$sourceSiteScript3 = Get -Content $inFile3</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Optionally publish as global template and site design from multiple files - add as many as needed</span><br/></div><div><span style="font-style:italic;">if ($createGlobalTemplate -and $importFromMultipleFiles) {</span></div><div><span style="font-style:italic;">&nbsp; $SiteScript1 = Add -SPOSiteScript -Title $inFile1Name -Content $sourceSiteScript1</span></div><div><span style="font-style:italic;">&nbsp; $SiteScript2 = Add -SPOSiteScript -Title $inFile2Name -Content $sourceSiteScript2</span></div><div><span style="font-style:italic;">&nbsp; $SiteScript3 = Add -SPOSiteScript -Title $inFile3Name -Content $sourceSiteScript3</span></div><div><br/></div><div><span style="font-style:italic;">&nbsp; # add as many as needed to the end of this line to add all of the scripts to the site design</span></div><div><span style="font-style:italic;">&nbsp; $SiteDesign = Add -SPOSiteDesign -Title $newSiteTitle -WebTemplate 64 -SiteScripts ($SiteScript1.Id,$SiteScript2.Id,$SiteScript3.Id)</span></div><div><span style="font-style:italic;">}</span></div><span style="font-style:italic;"><br/></span><div><span style="font-style:italic;"># Get site template list to show the ID of the newly created template and confirm it was successful</span><br/></div><div><span style="font-style:italic;">Get-SPOSiteDesign</span></div></span></div></div><div></div><div><div></div></div></div><div><span style="font-style:italic;font-size:12px;"></span></div></div><div></div></div><span style="font-size:10px;"><div><span style="font-style:italic;"></span></div></span></div></div>
</div><div data-element-id="elm_sUtnjM2-rkARJrdRVynvpQ" data-element-type="button" class="zpelement zpelem-button "><style></style><div class="zpbutton-container zpbutton-align-center zpbutton-align-mobile-center zpbutton-align-tablet-center"><style type="text/css"></style><a class="zpbutton-wrapper zpbutton zpbutton-type-primary zpbutton-size-md zpbutton-style-none " href="/services"><span class="zpbutton-content">See how we can help today!</span></a></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Sat, 14 Jan 2023 17:56:00 -0700</pubDate></item></channel></rss>