Manually installing Origami sample pages

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)
  1. 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
  1. Execution policy (Windows only, if needed)
# Run in an elevated Windows PowerShell/Terminal once
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
  1. Install PnP.PowerShell (cross-platform)
# In PowerShell 7+
Install-Module PnP.PowerShell -Scope CurrentUser
# If prompted to trust PSGallery, choose "Y"
  1. 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.

  1. Log into Azure: https://portal.azure.com

  2. Open Entra ID:
    image

  3. 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:

  4. Copy ID as shown below:

  5. 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: