Skip to content

Commit 4e2e6fa

Browse files
authored
Update site-design-powershell.md
Updated with details for new Set-SPOSiteScript cmdlet (available in Jan 2018 SharePoint PowerShell release)
1 parent d21a594 commit 4e2e6fa

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

docs/declarative-customization/site-design-powershell.md

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.date: 01/08/2018
99
> [!NOTE]
1010
> Site designs and site scripts are in preview and are subject to change. They are currently only supported for use in production environments in Targeted Release.
1111
12-
Use PowerShell cmdlets to create, retrieve, and remove site designs and site scripts.
12+
Use PowerShell cmdlets to create, retrieve, update, and remove site designs and site scripts.
1313

1414
## Getting started
1515

@@ -34,10 +34,7 @@ The following cmdlets are available for managing site designs and site scripts f
3434
- **Remove-SPOSiteScript**
3535
- **Revoke-SPOSiteDesignRights**
3636
- **Set-SPOSiteDesign**
37-
38-
<!--
3937
- **Set-SPOSiteScript**
40-
-->
4138

4239
<!-- TBD document pipe bind parameters -->
4340

@@ -349,7 +346,59 @@ C:\> Set-SPOSiteDesign `
349346
-PreviewImageUrl "https://contoso.sharepoint.com/SiteAssets/site-preview.png" `
350347
-PreviewImageAltText "site preview - version 2"
351348
```
349+
## Set-SPOSiteScript
350+
351+
Updates a previously uploaded site script.
352+
353+
```powershell
354+
Set-SPOSiteScript
355+
-Title <string>
356+
-Content <string>
357+
[-Description <string>]
358+
[<CommonParameters>]
359+
```
360+
361+
### Parameters
352362

363+
|Parameter | Description |
364+
|--------------|--------------|
365+
| -Title | The display name of the site design. |
366+
| -Content | JSON value that describes the script. For more information, see [JSON reference](site-design-json-schema.md).|
367+
| -Description | A description of the script. |
368+
369+
The following example updates a previously created site script. Any site designs referencing it will executed the updated script.
370+
371+
```json
372+
{
373+
"$schema": "schema.json",
374+
"actions": [
375+
{
376+
"verb": "addNavLink",
377+
"url": "/Custom Library",
378+
"displayName": "Custom Library Updated",
379+
"isWebRelative": true
380+
},
381+
{
382+
"verb": "addNavLink",
383+
"url": "/Lists/Custom List",
384+
"displayName": "Custom List Updated",
385+
"isWebRelative": true
386+
},
387+
{
388+
"verb": "applyTheme",
389+
themeName: "Contoso Explorers"
390+
}
391+
],
392+
"bindata": { },
393+
"version": 2
394+
}
395+
```
396+
Copy to clipboard
397+
398+
```powershell
399+
C:\> $script = Get-Clipboard -Raw
400+
C:\> Set-SPOSiteScript -Identity 7647d3d6-1046-41fe-a798-4ff66b099d12 -Content $script -Description "Update site script to change links and apply Contoso Explorers theme"
401+
```
353402

354403
## See also
355404

0 commit comments

Comments
 (0)