Skip to content

Instantly share code, notes, and snippets.

@ypcode
Created May 8, 2020 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypcode/752c4030daea0542e5f24c6004a865a9 to your computer and use it in GitHub Desktop.
Save ypcode/752c4030daea0542e5f24c6004a865a9 to your computer and use it in GitHub Desktop.
# Make sure all relative paths mentioned in the XML are valid related to the location of the XML file
$pnpTemplate = Read-PnPTenantTemplate -Path myTemplate.xml
# If the XML is invalid, you will have an error here
# Read-PnPTenantTemplate : The element 'AppCatalog' in namespace 'http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema' cannot contain text. List of possible
# elements expected: 'Package' in namespace 'http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema'.
# At line:1 char:16
# + $pnpTemplate = Read-PnPTenantTemplate -Path myTemplate.xml
# + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# + CategoryInfo : SyntaxError: (:) [Read-PnPTenantTemplate], XmlSchemaValidationException
# + FullyQualifiedErrorId : TEMPLATENOTVALID,SharePointPnP.PowerShell.Commands.Provisioning.Tenant.ReadTenantTemplate
# If the XML is valid, the $pnpTemplate contain the template object
###################################################################
# $pnpTemplate
# Parameters : {[TenantName, contoso], [SitePath, SiteDesignsStudio], [lcid, 1033], [TenantId, ]}
# Localizations : {}
# Tenant : OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTenant
# Version : 0
# Author : Yannick Plenevaux
# Generator : Manual
# Description : A Tenant template to install Site Designs Studio V2 solution
# DisplayName : Site Designs Studio V2
# ImagePreviewUrl :
# Connector : OfficeDevPnP.Core.Framework.Provisioning.Connectors.FileSystemConnector
# Templates : {SITE-DESIGNS-STUDIO-V2-APP}
# Sequences : {MAIN-SEQUENCE}
# Teams : OfficeDevPnP.Core.Framework.Provisioning.Model.Teams.ProvisioningTeams
# AzureActiveDirectory : OfficeDevPnP.Core.Framework.Provisioning.Model.AzureActiveDirectory.ProvisioningAzureActiveDirectory
# Drive : OfficeDevPnP.Core.Framework.Provisioning.Model.Drive.Drive
# ProvisioningWebhooks : {}
Save-PnPTenantTemplate -Template $pnpTemplate -Out myPackage.pnp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment