I am trying to add links to a Quick Links web part on a modern SharePoint site, to do this I am using PowerShell and JSON. I have obtained the web part as a JSON file and have accessed it using the Get-Content
command.
The JSON for the Quick Links web part looks like this:
{
"controlType": 3,
"id": "a9ed7796-5545-4623-a943-5be42762691d",
"position": {
"zoneIndex": 1,
"sectionIndex": 1,
"controlIndex": 1,
"layoutIndex": 1
},
"webPartId": "c70391ea-0b10-4ee9-b2b4-006d3fcad0cd",
"webPartData": {
"id": "c70391ea-0b10-4ee9-b2b4-006d3fcad0cd",
"instanceId": "a9ed7796-5545-4623-a943-5be42762691d",
"title": "Quick links",
"description": "Add links to important documents and pages.",
"serverProcessedContent": {
"htmlStrings": {},
"searchablePlainTexts": {
"items[0].title": "Yahoo",
"items[1].title": "Google"
},
"imageSources": {
"items[0].rawPreviewImageUrl": "https://s.yimg.com/cv/apiv2/social/images/yahoo_default_logo.png"
},
"links": {
"baseUrl": "https://bbpocoutlook.sharepoint.com/sites/tl23",
"items[0].sourceItem.url": "https://yahoo.com",
"items[1].sourceItem.url": "https://google.com"
},
"componentDependencies": {
"layoutComponentId": "706e33c8-af37-4e7b-9d22-6e5694d92a6f"
}
},
"dataVersion": "2.2",
"properties": {
"items": [
{
"sourceItem": {
"itemType": 2,
"fileExtension": "",
"progId": ""
},
"thumbnailType": 3,
"id": 2,
"description": "",
"altText": ""
},
{
"sourceItem": {
"itemType": 2,
"fileExtension": "",
"progId": ""
},
"thumbnailType": 3,
"id": 1,
"description": "",
"altText": ""
}
],
"isMigrated": true,
"layoutId": "List",
"shouldShowThumbnail": true,
"buttonLayoutOptions": {
"showDescription": false,
"buttonTreatment": 2,
"iconPositionType": 2,
"textAlignmentVertical": 2,
"textAlignmentHorizontal": 2,
"linesOfText": 2
},
"listLayoutOptions": {
"showDescription": false,
"showIcon": true
},
"waffleLayoutOptions": {
"iconSize": 1,
"onlyShowThumbnail": false
},
"hideWebPartWhenEmpty": true,
"dataProviderId": "QuickLinks",
"webId": "b5fdf80c-54ce-410f-a50d-910ea2e33250",
"siteId": "0c8f4c9a-71e6-4fc0-8355-9b52f0a7eb3a"
}
},
"emphasis": {},
"reservedHeight": 132,
"reservedWidth": 744,
"addedFromPersistedData": true
}
How would I add a new item to the web part and add a link to it?
For example, how would I add a link to stackoverflow to the quick link web part through PowerShell?