Skip to content

Commit 52d5d43

Browse files
Merge pull request #1040 from MicrosoftDocs/main
[AutoPublish] main to live - 09/25 01:35 PDT | 09/25 14:05 IST
2 parents 1bca7ef + 5f703e1 commit 52d5d43

File tree

1 file changed

+94
-22
lines changed
  • sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell

1 file changed

+94
-22
lines changed

sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md

Lines changed: 94 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,73 @@ Creates a new custom theme, or overwrites an existing theme to modify its settin
1818

1919
## SYNTAX
2020

21+
### NewThemeSet
2122
```
22-
Add-SPOTheme [-Identity] <SpoThemePipeBind> -Palette <SpoThemePalettePipeBind> -IsInverted <Boolean>
23-
[-Overwrite] [<CommonParameters>]
23+
Add-SPOTheme
24+
[-Identity] <SpoThemePipeBind>
25+
-ColorPairs <SpoThemeColorPairPipeBind>
26+
[-Overwrite]
27+
[<CommonParameters>]
28+
```
29+
30+
### LegacyThemeSet
31+
```
32+
Add-SPOTheme
33+
[-Identity] <SpoThemePipeBind>
34+
-Palette <SpoThemePalettePipeBind>
35+
-IsInverted <Boolean>
36+
[-Overwrite]
37+
[<CommonParameters>]
2438
```
2539

2640
## DESCRIPTION
41+
This cmdlet creates a new theme or updates an existing theme. The color pairs settings can be passed as a hash table, while the color palette settings can be passed as either a hash table or a dictionary.
42+
43+
Adding a theme does not automatically apply it to any site. Instead, the theme becomes available in the list of themes under the **Change the look** option for modern SharePoint pages.
44+
45+
Choose the appropriate parameter set based on whether you're working with a legacy or modern theme format. For details about the new theme format, see [Site theme](/sharepoint/site-theme).
46+
47+
> [!NOTE]
48+
> In multi-geo environments, themes added by an administrator in the primary geography are automatically propagated and available across the organization. This cmdlet is not supported for administrators in satellite geographies.
2749
28-
The **Add-SPOTheme** cmdlet creates a new theme or updates an existing theme. The color palette settings can be passed as either a hash table or a dictionary.
50+
## Examples
2951

30-
Adding a theme does not apply the theme to any sites. It adds the theme to your tenant store, and then the theme is available in the list of themes under the **Change the look** option for modern pages.
52+
### Example 1:
3153

32-
## EXAMPLES
54+
```powershell
55+
$colorPairs = @{
56+
light = @(
57+
@{ "accentColor": "#03787C"; "backgroundColor": "#FFFFFF" }
58+
@{ "accentColor": "#FFFFFF"; "backgroundColor": "#03787C" }
59+
@{ "accentColor": "#E3FFFD"; "backgroundColor": "#03787C" }
60+
@{ "accentColor": "#03787C"; "backgroundColor": "#E3FFFD" }
61+
@{ "accentColor": "#FFF9E3"; "backgroundColor": "#03787C" }
62+
@{ "accentColor": "#03787C"; "backgroundColor": "#FFF9E3" }
63+
@{ "accentColor": "#03787C"; "backgroundColor": "#F5F5F5" }
64+
@{ "accentColor": "#242424"; "backgroundColor": "#F5F5F5" }
65+
@{ "accentColor": "#155473"; "backgroundColor": "#FFFFFF" }
66+
@{ "accentColor": "#FFFFFF"; "backgroundColor": "#155473" }
67+
@{ "accentColor": "#155473"; "backgroundColor": "#E3FFFD" }
68+
@{ "accentColor": "#E3FFFD"; "backgroundColor": "#155473" }
69+
@{ "accentColor": "#FFF9E3"; "backgroundColor": "#155473" }
70+
@{ "accentColor": "#155473"; "backgroundColor": "#FFF9E3" }
71+
)
72+
}
73+
74+
Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs
75+
```
76+
77+
This example creates a theme named `"Teal Theme"` with color pair settings in various shades of teal.
78+
79+
### Example 2:
80+
81+
```powershell
82+
Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs -Overwrite
83+
```
3384

34-
### Example 1
85+
To update an existing theme in the new format, modify the color settings using the same syntax as when creating a theme. Add the `-Overwrite` flag to the Add-SPOTheme cmdlet.
3586

36-
In this example, a new theme named `"Custom Cyan"` is created, with color palette settings that are various shades of cyan. Note that the settings are passed as a hash table.
87+
### Example 3:
3788

3889
```powershell
3990
$themepalette = @{
@@ -67,17 +118,19 @@ $themepalette = @{
67118
Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false
68119
```
69120

121+
In this example, a theme named `"Custom Cyan"` is created, with color palette settings that are various shades of cyan. Note that the settings are passed as a hash table.
122+
70123
> [!NOTE]
71124
> Prior to the December 2017 release of the SPO Management Shell, the **Add-SPOTheme** cmdlet required that color palette settings be passed as a dictionary. We recommend that you use the latest version of the SPO Management Shell, or use the `HashToDictionary` function to convert a hash table to a dictionary if needed.
72125
73-
### Example 2
74-
75-
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.
126+
### Example 4: Overwrite a legacy format theme
76127

77128
```powershell
78129
Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false -Overwrite
79130
```
80131

132+
To update an existing legacy format theme and modify its color settings, use the same syntax as when creating the theme. Add the `-Overwrite` flag to the Add-SPOTheme cmdlet.
133+
81134
## PARAMETERS
82135

83136
### -Identity
@@ -98,34 +151,34 @@ Accept pipeline input: True (ByValue)
98151
Accept wildcard characters: False
99152
```
100153
101-
### -IsInverted
154+
### -Overwrite
102155
103156
> Applicable: SharePoint Online
104157
105-
Specifies whether the theme is inverted, with a dark background and a light foreground.
158+
Overwrites a theme of the same name in case it exists.
106159
107160
```yaml
108-
Type: System.Boolean
161+
Type: System.Management.Automation.SwitchParameter
109162
Parameter Sets: (All)
110163
Aliases: None
111164

112-
Required: True
165+
Required: False
113166
Position: Named
114167
Default value: None
115168
Accept pipeline input: False
116169
Accept wildcard characters: False
117170
```
118171
119-
### -Overwrite
172+
### -ColorPairs
120173
121174
> Applicable: SharePoint Online
122175
123-
Overwrites a theme of the same name in case it exists.
176+
Specifies the theme's color pairs using a hash table of slot values. Supports up to 16 color pairs.
124177
125178
```yaml
126-
Type: System.Management.Automation.SwitchParameter
127-
Parameter Sets: (All)
128-
Aliases: None
179+
Type: Microsoft.Online.SharePoint.PowerShell.SpoThemeColorPairPipeBind
180+
Parameter Sets: NewThemeSet
181+
Aliases:
129182

130183
Required: False
131184
Position: Named
@@ -138,14 +191,14 @@ Accept wildcard characters: False
138191
139192
> Applicable: SharePoint Online
140193
141-
Specifies the palette of colors in the theme, as a dictionary of theme slot values.
194+
Specifies the palette of colors in the theme, as a dictionary or hash table of theme slot values.
142195
143196
```yaml
144197
Type: Microsoft.Online.SharePoint.PowerShell.SpoThemePalettePipeBind
145-
Parameter Sets: (All)
198+
Parameter Sets: LegacyThemeSet
146199
Aliases:
147200

148-
Required: True
201+
Required: False
149202
Position: Named
150203
Default value: None
151204
Accept pipeline input: False
@@ -155,6 +208,24 @@ Accept wildcard characters: False
155208
### CommonParameters
156209
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
157210
211+
### -IsInverted
212+
213+
> Applicable: SharePoint Online
214+
215+
Specifies whether the theme is inverted, with a dark background and a light foreground.
216+
217+
```yaml
218+
Type: System.Boolean
219+
Parameter Sets: LegacyThemeSet
220+
Aliases: None
221+
222+
Required: False
223+
Position: Named
224+
Default value: None
225+
Accept pipeline input: False
226+
Accept wildcard characters: False
227+
```
228+
158229
## INPUTS
159230
160231
### Microsoft.Online.SharePoint.PowerShell.SpoThemePipeBind
@@ -166,3 +237,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
166237
## NOTES
167238
168239
## RELATED LINKS
240+
[Site theme](/sharepoint/site-theme)

0 commit comments

Comments
 (0)