0

We are looking at Site Designs for some things we want to do like Content Types, set theme, site columns, and I'm trying to add a really simple Site Scrip but I'm getting the following error. So I haven't been successful and cannot find help on how to troubleshoot this.

Add-SPOSiteScript : Nous n’avons pas pu traiter l’action setTitle. Le gestionnaire d’actions n’est pas inscrit pour cette action.
Au caractère C:\siteTest\test-SiteScript.ps1:14 : 36
+ ... File -Raw | Add-SPOSiteScript -Title $siteScriptTitle -Description $s ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-SPOSiteScript], ServerException
    + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.AddSPOSiteScript

Here is my PowerShell Script

$adminSiteUrl = "https://my0365-admin.sharepoint.com"
$siteScriptFile = $PSScriptRoot + "\test-SiteDesign.json"
$webTemplate = "68" #64 = Team Site, 68 = Communication Site

$siteScriptTitle = "TEST Site design script"
$siteDesignTitle = "TEST Site design script"
$siteDesignDescription = "Site design ."

$cred = Get-Credential

Connect-SPOService $adminSiteUrl -Credential $cred

Get-Content $siteScriptFile -Raw | Add-SPOSiteScript -Title $siteScriptTitle -Description $siteDesignDescription

And my Design

{
    "$schema": "schema.json",
    "actions": [
        {
            "verb": "setTitle",
            "title": "Titre du site"
         }
    ]
}
1

setTitle is a subAction. It needs to be inside the createSPList action.

Modify your JSON as below and then run your code it should work:

{
    "$schema": "schema.json",
    "actions": [
        {
            "verb": "createSPList",
            "listName": "Custom List",
            "templateType": 100,
            "subactions": [
                {
                   "verb": "setTitle",
                   "title": "Customers and Orders"
                }               
            ]
        }
    ]
}

Reference - Site Design JSON Schema

  • Yeah I figured that out late yeasterday evening. I misunderstood this. Thanks. – DSiconnelli Sep 7 '18 at 12:55
  • cool, you can accept it as answer by ticking the checkmark besides the answer. It will remove this from list of unanswered questions and help other users who might face similar issue. Cheers ! :) – Gautam Sheth Sep 7 '18 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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