Here’s a clean, end-to-end way to add Origami sample pages to your SharePoint Online Communication Site.
If your Microsoft SharePoint GCC or GCC High customer, this is how you’d install sample pages.
Part 1: Installing PowerShell (one-time)
- PowerShell
Follow this part only if you do not have PowerShell 7 installed on your computer, otherwise skip this step
- Windows 10/11: open Terminal and run:
winget install --id Microsoft.PowerShell -e - macOS (Homebrew):
brew install --cask powershell
- Execution policy (Windows only, if needed)
# Run in an elevated Windows PowerShell/Terminal once
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
- Install PnP.PowerShell (cross-platform)
# In PowerShell 7+
Install-Module PnP.PowerShell -Scope CurrentUser
# If prompted to trust PSGallery, choose "Y"
- Permissions you’ll need
- Site Collection Admin on the site where you want to install Origami samples.
Part 2: Get ClientID
ClientID will allow the PowerShell script authenticate to your tenant, here is how to retrieve it.
-
Log into Azure: https://portal.azure.com
-
Open Entra ID:

-
Click on App registrations → All applications → PnP
NOTE: If you don’t have PnP application, you can create a new PnP registration and give it necessary permission as pointed by red arrows below:
-
Copy ID as shown below:
-
When you click on PnP application, ensure you have given it AllSites.FullControl permission as shown below:
Part 3: Run PowerShell script to install sample pages
Replace highlighted variables in the PowerShell script below.
Then, copy and paste the script into your PowerShell command window.
$TargetSiteUrl = "https://tenantname.sharepoint.com/sites/SiteCollectionName" <--change to your site URL
$TargetSiteServerRelativeUrl = "/sites/SiteCollectionName" <--change to your site relative URL
$ClientId = "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX" <--change to your ClientID
$ImportJsonUrl = "https://origamiinstallation.blob.core.windows.net/templates/Homepage-page-definition.json"
Connect-PnPOnline `
-Url $TargetSiteUrl `
-Interactive `
-ClientId $ClientId
$pageDefinition = Invoke-RestMethod -Uri $ImportJsonUrl -Method Get
$pageName = $pageDefinition.PageName
$pageTitle = $pageDefinition.Title
# Create asset folder if missing
Resolve-PnPFolder -SiteRelativePath "SiteAssets/PageAssets" | Out-Null
# Upload embedded images and replace source URLs
foreach ($asset in $pageDefinition.Assets) {
Write-Host "Importing image: $($asset.FileName)" -ForegroundColor Cyan
$bytes = [Convert]::FromBase64String($asset.Base64)
$tempAssetPath = Join-Path $env:TEMP $asset.FileName
[System.IO.File]::WriteAllBytes($tempAssetPath, $bytes)
Add-PnPFile `
-Path $tempAssetPath `
-Folder "SiteAssets/PageAssets" `
-NewFileName $asset.FileName
$newUrl = "$TargetSiteServerRelativeUrl/$($asset.TargetPath)"
if ($pageDefinition.CanvasContent1) {
$pageDefinition.CanvasContent1 =
$pageDefinition.CanvasContent1.Replace($asset.OriginalUrl, $newUrl)
}
if ($pageDefinition.LayoutWebpartsContent) {
$pageDefinition.LayoutWebpartsContent =
$pageDefinition.LayoutWebpartsContent.Replace($asset.OriginalUrl, $newUrl)
}
}
# Create page if missing
$existingPage = Get-PnPListItem -List "Site Pages" -Query @"
<View>
<Query>
<Where>
<Eq>
<FieldRef Name='FileLeafRef' />
<Value Type='File'>$pageName</Value>
</Eq>
</Where>
</Query>
</View>
"@
if (-not $existingPage) {
Add-PnPPage -Name $pageName -LayoutType Article
}
$pageItem = Get-PnPListItem -List "Site Pages" -Query @"
<View>
<ViewFields>
<FieldRef Name='Title' />
<FieldRef Name='CanvasContent1' />
<FieldRef Name='LayoutWebpartsContent' />
<FieldRef Name='PageLayoutType' />
<FieldRef Name='FileLeafRef' />
</ViewFields>
<Query>
<Where>
<Eq>
<FieldRef Name='FileLeafRef' />
<Value Type='File'>$pageName</Value>
</Eq>
</Where>
</Query>
</View>
"@
Set-PnPListItem `
-List "Site Pages" `
-Identity $pageItem.Id `
-Values @{
Title = $pageTitle
CanvasContent1 = $pageDefinition.CanvasContent1
LayoutWebpartsContent = $pageDefinition.LayoutWebpartsContent
PageLayoutType = $pageDefinition.PageLayoutType
}
Write-Host "Imported page and assets: $pageName" -ForegroundColor Green
Part 4: Upload additional sample pages
You’ll notice in Part 3 this line:
https://origamiinstallation.blob.core.windows.net/templates/Homepage-page-definition.json
This installs a sample page for a Homepage.
You can install other sample pages by re-running the script in Part 3 with any of these URLs for site definition:
- Benefits page: https://origamiinstallation.blob.core.windows.net/templates/Benefits-page-definition.json
- Homepage 1: https://origamiinstallation.blob.core.windows.net/templates/Homepage1-page-definition.json
- Homepage 2: https://origamiinstallation.blob.core.windows.net/templates/Homepage2-page-definition.json
- Homepage 3: https://origamiinstallation.blob.core.windows.net/templates/Homepage3-page-definition.json
- Homepage 4: https://origamiinstallation.blob.core.windows.net/templates/Homepage4-page-definition.json
- Homepage 5: https://origamiinstallation.blob.core.windows.net/templates/Homepage5-page-definition.json
- Knowledgebase Article: https://origamiinstallation.blob.core.windows.net/templates/KnowledgebaseArticle-page-definition.json
- Knowledgebase Category: https://origamiinstallation.blob.core.windows.net/templates/KnowledgebaseCategory-page-definition.json
- Knowledgebase Home: https://origamiinstallation.blob.core.windows.net/templates/LearningHome-page-definition.json
- Training Home: https://origamiinstallation.blob.core.windows.net/templates/LearningHub-page-definition.json
- News Center: https://origamiinstallation.blob.core.windows.net/templates/NewsCenter-page-definition.json
- Onboarding: https://origamiinstallation.blob.core.windows.net/templates/Onboarding-preview.png
- Payroll & Expenses: https://origamiinstallation.blob.core.windows.net/templates/PayrollandExpenses-page-definition.json