Skip to content

Commit 00c08c6

Browse files
committed
Edit pass.
1 parent 259f8ba commit 00c08c6

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

docs/declarative-customization/site-theming/sharepoint-site-theming-powershell.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# SharePoint site theming: PowerShell commands
22

3-
Tenant administrators can use the PowerShell commands covered below to create, retrieve, and remove site themes. Note that developers can also use the SharePoint [REST API](sharepoint-site-theming-rest-api.md) to handle theme management tasks.
3+
<!-- Global: We should refer to PowerShell "cmdlets" instead of "commands", to be consistent with the admin docs on TechNet. -->
4+
5+
SharePoint tenant administrators can use PowerShell commands 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.
46

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

79
## Getting started
810

9-
To run the PowerShell commands for theme management you'll need to download and install the SharePoint Online Management Shell and then connect to your SharePoint tenant from within the shell:
11+
To run the PowerShell commands for theme management, you'll need to download and install the SharePoint Online Management Shell, and then connect to your SharePoint tenant from within the shell:
1012

11-
* Download and install the SharePoint Online Management Shell from this page: [https://www.microsoft.com/en-us/download/details.aspx?id=35588](https://www.microsoft.com/en-us/download/details.aspx?id=35588). If you already have a previous of the shell installed, un-install it first and then install the latest version from the link.
12-
* After the shell is installed, follow the instructions at [Connect to SharePoint Online PowerShell](https://technet.microsoft.com/en-us/library/fp161372.aspx) to connect to your SharePoint tenant.
13+
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.
14+
2. After the shell is installed, follow the instructions at [Connect to SharePoint Online PowerShell](https://technet.microsoft.com/en-us/library/fp161372.aspx) to connect to your SharePoint tenant.
1315

14-
To verify your setup, try using the Get-HideDefaultThemes command to read the HideDefaultThemes setting. If it runs and returns False with no errors as shown below, you're ready to proceed.
16+
To verify your setup, try using the **Get-HideDefaultThemes** command to read the HideDefaultThemes setting. If the command runs and returns False with no errors, as shown in the following example, you're ready to proceed.
1517

1618
```powershell
1719
c:\> Get-HideDefaultThemes
@@ -21,19 +23,17 @@ False
2123

2224
The following commands are available for managing site themes from PowerShell:
2325

24-
* _Add-SPOTheme_ &mdash; create a new custom theme, or over-write an existing theme to modify its settings
25-
* _Get-SPOTheme_ &mdash; retrieve settings for an existing theme
26-
* _Remove-SPOTheme_ &mdash; remove a theme from the theme gallery
27-
* _Set-HideDefaultThemes_ &mdash; specify whether or not the default "out of box" themes should be available
28-
* _Get-HideDefaultThemes_ &mdash; query the current HideDefaultThemes setting
29-
30-
Each of these commands is described in more detail below.
26+
* **Add-SPOTheme** &mdash; Creates a new custom theme, or overwrites an existing theme to modify its settings.
27+
* **Get-SPOTheme** &mdash; Retrieves settings for an existing theme.
28+
* **Remove-SPOTheme** &mdash; Removes a theme from the theme gallery.
29+
* **Set-HideDefaultThemes** &mdash; Specifies whether the default themes should be available.
30+
* **Get-HideDefaultThemes** &mdash; Queries the current HideDefaultThemes setting.
3131

3232
## Add-SPOTheme
3333

34-
This command creates a new theme or updates an existing theme. The color pallette settings are passed as a dictionary.
34+
The **Add-SPOTheme** command creates a new theme or updates an existing theme. The color pallette settings are passed as a dictionary.
3535

36-
In the example below, a new theme named "Custom Cyan" is created, with color pallette settings that are various shades of cyan. Note that this example uses a ```HashToDictionary``` function to convert a hash table created with the ```@{}``` notation into a dictionary as required by Add-SPOTheme.
36+
In the following example, a new theme named "Custom Cyan" is created, with color pallette settings that are various shades of cyan. Note that this example uses a ```HashToDictionary``` function to convert a hash table created with the ```@{}``` notation into a dictionary, as required by **Add-SPOTheme**.
3737

3838
```powershell
3939
function HashToDictionary {
@@ -77,15 +77,16 @@ $themepallette = HashToDictionary(
7777
7878
Add-SPOTheme -Name "Custom Cyan" -Palette $themepallette -IsInverted $false
7979
```
80-
If you would like to update an existing theme (to modify some of its color settings, for example), use the same syntax as shown above but add the *-Overwrite* flag to the Add-SPOTheme command:
80+
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** command.
81+
8182
```powershell
8283
Add-SPOTheme -Name "Custom Cyan" -Palette $themepallette -IsInverted $false -Overwrite
8384
```
84-
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.
85+
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.
8586

8687
## Get-SPOTheme
8788

88-
This command returns the settings for an existing theme. For example, here's how to use the Get-SPOTheme command to return the settings for the "Custom Cyan" theme created in the previous example:
89+
The **Get-SPOTheme** command returns the settings for an existing theme. For example, here's how to use the **Get-SPOTheme** command to return the settings for the "Custom Cyan" theme created in the previous example.
8990

9091
```powershell
9192
C:\> Get-SPOTheme -Name "Custom Cyan" | ConvertTo-Json
@@ -123,9 +124,9 @@ C:\> Get-SPOTheme -Name "Custom Cyan" | ConvertTo-Json
123124
"IsInverted": false
124125
}
125126
```
126-
Note that the example above uses PowerShell's _ConvertTo-Json_ filter to display the theme in JSON format.
127+
Note that this example uses the PowerShell _ConvertTo-Json_ filter to display the theme in JSON format.
127128

128-
To see all of the themes currently available in the tenant store, use Get-SPOTheme with no arguments:
129+
To see all the themes currently available in the tenant store, use **Get-SPOTheme** with no arguments.
129130

130131
```powershell
131132
c:\> Get-SPOTheme
@@ -141,40 +142,43 @@ Custom Cyan
141142
```
142143
## Remove-SPOTheme
143144

144-
This command removes a theme from your tenant store. For example, this command removes the "Custom Cyan" theme that was used in the above examples:
145+
The **Remove-SPOTheme** command removes a theme from your tenant store. For example, this command removes the "Custom Cyan" theme that was used in the previous examples.
146+
145147
```powershell
146148
c:\> Remove-SPOTheme -Name "Custom Cyan"
147149
```
148150
## Set-HideDefaultThemes
149151

150-
_NOTE: this command will be renamed to ```Set-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell commands. This document will be updated to reflect the change at that time._
152+
_NOTE: this command will be renamed to ```Set-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell commands._
153+
154+
The **Set-HideDefaultThemes** command 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.
151155

152-
This command is used to specify whether or not the default themes that come with SharePoint should be included in the theme picker list. For example, you may want to create custom themes for your sites and then remove the default themes, to assure that all pages will use your custom themes.
156+
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 command hides the default themes.
153157

154-
Specify the setting as either _$trule_ to hide the default themes, or _$false_ (the default setting) to allow use of the default themes. For example, this command hides the default themes:
155158
```powershell
156159
Set-HideDefaultThemes $true
157160
```
158-
After creating the "Custom Cyan" theme as shown above under Add-SPOTheme, hiding the default themes will leave only the one custom theme in the themes list under the gear icon / Change the look:
161+
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**.
159162

160-
![hide default themes](../../images/theme-hidedefaults.png)
163+
![Change the look box with default themes hidden and the custom Cyan theme shown](../../images/theme-hidedefaults.png)
161164

162-
To restore the default themes to the theme picker list, use this command:
165+
To restore the default themes to the theme picker list, use the following command.
163166
```powershell
164167
Set-HideDefaultThemes $false
165168
```
166169

167170
## Get-HideDefaultThemes
168171

169-
_NOTE: this command will be renamed to ```Get-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell commands. This document will be updated to reflect the change at that time._
172+
_NOTE: this command will be renamed to ```Get-SPOHideDefaultThemes``` in a future release, for consistency with other SharePoint PowerShell commands._
173+
174+
The **Get-HideDefaultThemes** command retrieves the currrent **Set-HideDefaultThemes** setting. You might want to use this command in a PowerShell script to read the setting and then take different actions based on whether the default themes are hidden. This command does not have any parameters.
170175

171-
This command retrieves the currrent Set-HideDefaultThemes setting. You may want to use this command in a PowerShell script to read the setting and then take different actions based on whether the default themes are hidden or not. There are no parameters for this command:
172176
```powershell
173177
c:\> Get-HideDefaultThemes
174178
False
175179
```
176180

177-
## Additional resources
181+
## See also
178182

179183
* [SharePoint site theming overview](sharepoint-site-theming-overview.md)
180184
* [SharePoint site theming: JSON schema](sharepoint-site-theming-json-schema.md)

0 commit comments

Comments
 (0)