SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.02k forks source link

Issues running provided code sample #8698

Open Rykimaruh opened 1 year ago

Rykimaruh commented 1 year ago

I'm trying to follow the steps in this article and I get an error message midway through.

I'm using the provided script from the article

$site_script = '
 {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
         "actions": [
             {
                 "verb": "createSPList",
                 "listName": "Customer Tracking",
                 "templateType": 100,
                 "subactions": [
                     {
                         "verb": "setDescription",
                         "description": "List of Customers and Orders"
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "Text",
                         "displayName": "Customer Name",
                         "isRequired": false,
                         "addToDefaultView": true
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "Number",
                         "displayName": "Requisition Total",
                         "addToDefaultView": true,
                         "isRequired": true
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "User",
                         "displayName": "Contact",
                         "addToDefaultView": true,
                         "isRequired": true
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "Note",
                         "displayName": "Meeting Notes",
                         "isRequired": false
                     }
                 ]
             }
         ]
 }
 '

Something wrong with the provided script when I run it:

Add-SPOSiteScript
 -Title "Create customer tracking list"
 -Content $site_script
 -Description "Creates list for tracking customer contact information"

I get the following error in Powershell: Add-SPOSiteScript : Unexpected character encountered while parsing value: $. Path '', line 0, position 0.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ghost commented 1 year ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.