0

I am looking to extract a template with its theme from a site in SP Online. I have the code

Get-PnPProvisioningTemplate -Configuration "template.json" -Out "template.xml" -Force

and for the template.json

{
    "$schema": "https://aka.ms/sppnp-extract-configuration-schema",
    "persistAssetFiles": false,
    "handlers": [
        "Lists",
        "WebSettings",
        "Pages",
        "Theme"
    ],
    "lists": {
        "lists": [
            {
                "title": "Banner",
                "includeItems": true
            }
        ]
    },
    "navigation": {
        "removeExistingNodes": true
    },
    "siteFooter": {
        "removeExistingNodes": true
    },
    "pages": {
        "includeAllClientSidePages": true
    }
}

But when I save the file, there is no <pnp:Theme> element. However before I extracted it, I set a site theme on the site. Anyone know what's wrong?

Thanks

1 Answer 1

0

Theme is not in the list of handlers:

https://docs.microsoft.com/en-us/dotnet/api/officedevpnp.core.framework.provisioning.model.handlers?view=sharepoint-pnpcoreol-3.2.1810

2
  • Yes it is, the docs must be outdated. If you go to developer.microsoft.com/en-us/json-schemas/pnp/provisioning/…, the second last one above SiteSettings is Theme. Additionally, if I manually add the <pnp:Theme> afterwards to the extracted xml, it will get set when applying to the site.
    – omega
    Commented Dec 8, 2020 at 0:11
  • While I appreciate the above schema, this does not mean that the functionality to extract the theme actually exists in the Get-PnPProvisioningTemplate cmdlet. You could however raise this as a bug on GitHub. Commented Dec 8, 2020 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.