0

I am attempting to grab the Id from a site script generated from Get-PnPSiteScriptFromWeb but am somehow unable to (?) I want to use it in Add-PnPSiteDesign on the following line.

$SPTemplateSite = "https://TEST.sharepoint.com/teams/TeamTemplate"
$SiteScript = Get-PnPSiteScriptFromWeb -Url $SPTemplateSite -IncludeAll | Select Id
$SiteScript.Id
$SiteDesign = Add-PnPSiteDesign -Title "NH Project Site" -SiteScriptIds $SiteScript.Id -WebTemplate TeamSite

Getting an error "Cannot bind argument to parameter 'SiteScriptIds' because it is null."

1
  • 1
    If ID is null you might wanna make sure that you are connection to your admin site. From the docs: "This command allows a Site Script to be generated off of an existing site on your tenant. Connect to your SharePoint Online Admin site before executing this command." Commented Mar 30, 2021 at 13:25

1 Answer 1

0

The error shows the ID value is null, please check whether the ID value is obtained:

$SiteScript = Get-PnPSiteScriptFromWeb -Url $SPTemplateSite -IncludeAll | Select Id
$SiteScript

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.