Skip to content

Commit 03bf82a

Browse files
author
Linda Caputo
committed
Updates to PowerShell "TOC" pages
1 parent 9698a8b commit 03bf82a

File tree

2 files changed

+26
-176
lines changed

2 files changed

+26
-176
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: PowerShell cmdlets for SharePoint site designs and site scripts
2+
title: SharePoint site design - PowerShell cmdlets
33
description: Use PowerShell cmdlets to create, retrieve, and remove site designs and site scripts.
4-
ms.date: 03/19/2018
4+
ms.date: 03/22/2018
55
---
66

7-
# PowerShell cmdlets for SharePoint site designs and site scripts
7+
# SharePoint site design: PowerShell cmdlets
88

99
> [!NOTE]
1010
> Site designs and site scripts have been released to production and are available for general use.
@@ -16,6 +16,7 @@ Use PowerShell cmdlets to create, retrieve, update, and remove site designs and
1616
To run the PowerShell cmdlets, you'll need to do the following:
1717

1818
1. Download and install the [SharePoint Online Management Shell](https://www.microsoft.com/en-us/download/details.aspx?id=35588). If you already have a previous version of the shell installed, uninstall it first and then install the latest version.
19+
1920
2. Follow the instructions at [Connect to SharePoint Online PowerShell](https://technet.microsoft.com/en-us/library/fp161372.aspx) to connect to your SharePoint tenant.
2021

2122
To verify your setup, try using the [Get-SPOSiteScript](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Get-SPOSiteScript?view=sharepoint-ps) cmdlet to read the current list of site scripts. If the cmdlet runs and returns with no errors, you're ready to proceed.
@@ -35,9 +36,7 @@ The following cmdlets are available for managing site designs and site scripts f
3536
- [Remove-SPOSiteScript](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Remove-SPOSiteScript?view=sharepoint-ps)
3637
- [Revoke-SPOSiteDesignRights](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Revoke-SPOSiteDesignRights?view=sharepoint-ps)
3738
- [Set-SPOSiteDesign](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Set-SPOSiteDesign?view=sharepoint-ps)
38-
39-
<!-- This particular page is not publishing for some reason; saving the link to turn on when it finally behaves :-(
40-
- [Set-SPOSiteScript](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Set-SPOSiteScript?view=sharepoint-ps)-->
39+
- [Set-SPOSiteScript](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Set-SPOSiteScript?view=sharepoint-ps)
4140

4241

4342

Lines changed: 21 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -1,191 +1,42 @@
1+
---
2+
title: SharePoint site theming - PowerShell cmdlets
3+
description: SharePoint tenant administrators can use PowerShell cmdlets to create, retrieve, and remove site themes. Developers can use the SharePoint REST API to handle theme management tasks.
4+
ms.date: 03/22/2018
5+
---
6+
17
# SharePoint site theming: PowerShell cmdlets
28

3-
SharePoint tenant administrators can use PowerShell cmdlets to create, retrieve, and remove site themes. Developers can also use the SharePoint [REST API](sharepoint-site-theming-rest-api.md) to handle theme management tasks.
9+
SharePoint tenant administrators can use PowerShell cmdlets to create, retrieve, and remove site themes.
10+
11+
Developers can use the SharePoint [REST API](sharepoint-site-theming-rest-api.md) to handle theme management tasks.
412

513
For information about how themes are defined and stored, see [JSON schema reference](sharepoint-site-theming-json-schema.md).
614

715
## Getting started
816

9-
To run the PowerShell cmdlets for theme management, you'll need to do the following:
17+
To run the PowerShell cmdlets for theme management, you must do the following:
1018

1119
1. Download and install the [SharePoint Online Management Shell](https://www.microsoft.com/en-us/download/details.aspx?id=35588). If you already have a previous version of the shell installed, uninstall it first and then install the latest version.
20+
1221
2. Follow the instructions at [Connect to SharePoint Online PowerShell](https://technet.microsoft.com/en-us/library/fp161372.aspx) to connect to your SharePoint tenant.
1322

14-
To verify your setup, try using the **Get-SPOHideDefaultThemes** cmdlet to read the SPOHideDefaultThemes setting. If the cmdlet runs and returns False with no errors, as shown in the following example, you're ready to proceed.
23+
To verify your setup, try using the [Get-SPOHideDefaultThemes](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Get-SPOHideDefaultThemes?view=sharepoint-ps) cmdlet to read the SPOHideDefaultThemes setting. If the cmdlet runs and returns False with no errors, as shown in the following example, you're ready to proceed.
1524

16-
```powershell
17-
c:\> Get-SPOHideDefaultThemes
18-
False
19-
```
2025
## Site theme cmdlets
2126

2227
The following cmdlets are available for managing site themes from PowerShell:
2328

24-
* **Add-SPOTheme** &mdash; Creates a new custom theme, or overwrites an existing theme to modify its settings.
25-
* **Get-SPOTheme** &mdash; Retrieves settings for an existing theme.
26-
* **Remove-SPOTheme** &mdash; Removes a theme from the theme gallery.
27-
* **Set-SPOHideDefaultThemes** &mdash; Specifies whether the default themes should be available.
28-
* **Get-SPOHideDefaultThemes** &mdash; Queries the current SPOHideDefaultThemes setting.
29-
30-
## Add-SPOTheme
31-
32-
The **Add-SPOTheme** cmdlet creates a new theme or updates an existing theme. The color pallette settings can be passed as either a hash table or a dictionary.
33-
34-
In the following example, a new theme named "Custom Cyan" is created, with color pallette settings that are various shades of cyan. Note that the settings are passed as a hash table.
35-
36-
```powershell
37-
$themepallette = @{
38-
"themePrimary" = "#00ffff";
39-
"themeLighterAlt" = "#f3fcfc";
40-
"themeLighter" = "#daffff";
41-
"themeLight" = "#affefe";
42-
"themeTertiary" = "#76ffff";
43-
"themeSecondary" = "#39ffff";
44-
"themeDarkAlt" = "#00c4c4";
45-
"themeDark" = "#009090";
46-
"themeDarker" = "#005252";
47-
"neutralLighterAlt" = "#f8f8f8";
48-
"neutralLighter" = "#f4f4f4";
49-
"neutralLight" = "#eaeaea";
50-
"neutralQuaternaryAlt" = "#dadada";
51-
"neutralQuaternary" = "#d0d0d0";
52-
"neutralTertiaryAlt" = "#c8c8c8";
53-
"neutralTertiary" = "#a6a6a6";
54-
"neutralSecondaryAlt" = "#767676";
55-
"neutralSecondary" = "#666666";
56-
"neutralPrimary" = "#333";
57-
"neutralPrimaryAlt" = "#3c3c3c";
58-
"neutralDark" = "#212121";
59-
"black" = "#000000";
60-
"white" = "#fff";
61-
"primaryBackground" = "#fff";
62-
"primaryText" = "#333"
63-
}
64-
65-
Add-SPOTheme -Name "Custom Cyan" -Palette $themepallette -IsInverted $false
66-
```
67-
68-
> [!NOTE]
69-
> Prior to the December 2017 release of SPO Management Shell, the **Add-SPOTheme**
70-
> cmdlet required that color pallette settings be passed as a dictionary. We recommend
71-
> that you use the latest version of the SPO Management Shell, however the following
72-
> ```HashToDictionary``` function can be used to convert a hash table to a
73-
> dictionary if needed.
74-
75-
```powershell
76-
function HashToDictionary {
77-
Param ([Hashtable]$ht)
78-
$dictionary = New-Object "System.Collections.Generic.Dictionary``2[System.String,System.String]"
79-
foreach ($entry in $ht.GetEnumerator()) {
80-
$dictionary.Add($entry.Name, $entry.Value)
81-
}
82-
return $dictionary
83-
}
84-
```
85-
If you want to update an existing theme (to modify some of its color settings, for example), use the same syntax as shown previously but add the *-Overwrite* flag to the **Add-SPOTheme** cmdlet.
86-
87-
```powershell
88-
Add-SPOTheme -Name "Custom Cyan" -Palette $themepallette -IsInverted $false -Overwrite
89-
```
90-
Adding a theme does not apply the theme to any sites. It adds the theme to your tenant store, and then the theme will be available in the list of themes under the **Change the look** option for modern pages.
91-
92-
## Get-SPOTheme
93-
94-
The **Get-SPOTheme** cmdlet returns the settings for a named existing theme, or for all uploaded themes if no name is provided.
95-
96-
Here's how to use the **Get-SPOTheme** cmdlet to return the settings for the "Custom Cyan" theme created in the previous example.
97-
98-
```powershell
99-
C:\> Get-SPOTheme -Name "Custom Cyan" | ConvertTo-Json
100-
```
101-
```json
102-
{
103-
"Name": "Custom Cyan",
104-
"Palette": {
105-
"themeLight": "#affefe",
106-
"themeTertiary": "#76ffff",
107-
"black": "#000000",
108-
"neutralSecondary": "#666666",
109-
"neutralTertiaryAlt": "#c8c8c8",
110-
"themeSecondary": "#39ffff",
111-
"themeDarker": "#005252",
112-
"primaryBackground": "#fff",
113-
"neutralQuaternary": "#d0d0d0",
114-
"neutralPrimaryAlt": "#3c3c3c",
115-
"neutralPrimary": "#333",
116-
"themeDark": "#009090",
117-
"themeLighter": "#daffff",
118-
"neutralTertiary": "#a6a6a6",
119-
"neutralQuaternaryAlt": "#dadada",
120-
"themeLighterAlt": "#f3fcfc",
121-
"white": "#fff",
122-
"neutralSecondaryAlt": "#767676",
123-
"neutralLighter": "#f4f4f4",
124-
"neutralLight": "#eaeaea",
125-
"neutralDark": "#212121",
126-
"themeDarkAlt": "#00c4c4",
127-
"neutralLighterAlt": "#f8f8f8",
128-
"primaryText": "#333",
129-
"themePrimary": "#00ffff"
130-
},
131-
"IsInverted": false
132-
}
133-
```
134-
Note that this example uses the PowerShell _ConvertTo-Json_ filter to display the theme in JSON format.
135-
136-
To return all uploaded themes, use the **Get-SPOTheme** command with no arguments:
137-
138-
```powershell
139-
C:\> Get-SPOTheme
140-
```
141-
142-
Here's an example of the output from this command:
143-
144-
![Get-SPOTheme example](../../images/Get-SPOTheme-example.png)
145-
146-
## Remove-SPOTheme
147-
148-
The **Remove-SPOTheme** cmdlet removes a theme from your tenant store. For example, this cmdlet removes the "Custom Cyan" theme that was used in the previous examples.
149-
150-
```powershell
151-
c:\> Remove-SPOTheme -Name "Custom Cyan"
152-
```
153-
## Set-SPOHideDefaultThemes
154-
155-
> [!NOTE]
156-
> This cmdlet was named ```Set-HideDefaultThemes``` until the December 2017 release of SPO Management Shell. We recommend that you use the latest version of the PowerShell cmdlets.
157-
158-
The **Set-SPOHideDefaultThemes** cmdlet is used to specify whether the default themes that come with SharePoint should be included in the theme picker list. For example, you might want to create custom themes for your sites and then remove the default themes, to ensure that all pages will use your custom themes.
159-
160-
Specify the setting as either _$true_ to hide the default themes, or _$false_ (the default setting) to allow use of the default themes. For example, this cmdlet hides the default themes.
161-
162-
```powershell
163-
Set-SPOHideDefaultThemes $true
164-
```
165-
After creating the "Custom Cyan" theme, hiding the default themes will leave only the one custom theme in the themes list under **Change the look**.
166-
167-
To restore the default themes to the theme picker list, use the following cmdlet.
168-
```powershell
169-
Set-SPOHideDefaultThemes $false
170-
```
171-
172-
## Get-SPOHideDefaultThemes
173-
174-
> [!NOTE]
175-
> this cmdlet was named ```Get-HideDefaultThemes``` until the December 2017 release of SPO Management Shell. We recommend that you use the latest version of the PowerShell cmdlets.
176-
177-
The **Get-SPOHideDefaultThemes** cmdlet retrieves the currrent **Set-SPOHideDefaultThemes** setting. You might want to use this cmdlet in a PowerShell script to read the setting and then take different actions based on whether the default themes are hidden. This cmdlet does not have any parameters.
178-
179-
```powershell
180-
c:\> Get-SPOHideDefaultThemes
181-
False
182-
```
29+
* [Add-SPOTheme](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Add-SPOTheme?view=sharepoint-ps) &ndash; Creates a new custom theme, or overwrites an existing theme to modify its settings.
30+
* [Get-SPOTheme](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Get-SPOTheme?view=sharepoint-ps) &ndash; Retrieves settings for an existing theme.
31+
* [Remove-SPOTheme](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Remove-SPOTheme?view=sharepoint-ps) &ndash; Removes a theme from the theme gallery.
32+
* [Set-SPOHideDefaultThemes](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Set-SPOHideDefaultThemes?view=sharepoint-ps) &ndash; Specifies whether the default themes should be available.
33+
* [Get-SPOHideDefaultThemes](https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Get-SPOHideDefaultThemes?view=sharepoint-ps) &ndash; Queries the current SPOHideDefaultThemes setting.
34+
18335

18436
## See also
18537

18638
* [SharePoint site theming overview](sharepoint-site-theming-overview.md)
187-
* [SharePoint site theming: JSON schema](sharepoint-site-theming-json-schema.md)
18839
* [SharePoint site theming: CSOM](sharepoint-site-theming-csom.md)
189-
* [SharePoint site theming: REST API](sharepoint-site-theming-rest-api.md)
190-
* [SharePoint Online Management Shell](https://www.microsoft.com/en-us/download/details.aspx?id=35588)
191-
* [Connect to SharePoint Online PowerShell](https://technet.microsoft.com/en-us/library/fp161372.aspx)
40+
41+
42+

0 commit comments

Comments
 (0)