From bec4e6e56add7986a0c178a87a11969f073e0558 Mon Sep 17 00:00:00 2001 From: Rongqi Zhou Date: Tue, 2 Sep 2025 14:13:06 +0800 Subject: [PATCH 1/9] support to add theme v2 --- .../Add-SPOTheme.md | 98 +++++++++++++++---- 1 file changed, 77 insertions(+), 21 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index 9b8d3dcdb..af0f172f8 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -18,22 +18,37 @@ Creates a new custom theme, or overwrites an existing theme to modify its settin ## SYNTAX +### LegacyThemeSet ``` -Add-SPOTheme [-Identity] -Palette -IsInverted - [-Overwrite] [] +Add-SPOTheme + [-Identity] + -Palette + -IsInverted + [-Overwrite] + [] ``` -## DESCRIPTION +### NewThemeSet +``` +Add-SPOTheme + [-Identity] + -ColorPairs + [-Overwrite] + [] +``` -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. +## DESCRIPTION +The **Add-SPOTheme** cmdlet creates a new theme or updates an existing theme. The color palette and color pairs settings can be passed as either a hash table or a dictionary. 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. -## EXAMPLES +You can choose which parameter set to use depending on the legacy or new theme format you want to add. Please read [Site theme](https://learn.microsoft.com/sharepoint/site-theme) for more about new theme. + -### Example 1 +## Examples -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. +### Example 1: Add a legacy format theme +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. ```powershell $themepalette = @{ @@ -70,14 +85,37 @@ Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false > [!NOTE] > 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. -### Example 2 +### Example 2: Overwrite a legacy format theme -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. +If you want to update an existing legacy format 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. ```powershell Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false -Overwrite ``` +### Example 3: Add a new format theme +```powershell +$colorPairs = @{ + light = @( + @{ + foregroundColor = '#00ffff' + backgroundColor = '#fff' + }, + @{ + foregroundColor = '#fff' + backgroundColor = '#00ffff' + } + ) +} + +Add-SPOTheme -Identity "Custom Cyan" -ColorPairs $colorPairs +``` + +### Example 4: Overwrite a new format theme +```powershell +Add-SPOTheme -Identity "Custom Cyan" -ColorPairs $colorPairs -Overwrite +``` + ## PARAMETERS ### -Identity @@ -98,36 +136,36 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -IsInverted +### -Overwrite > Applicable: SharePoint Online -Specifies whether the theme is inverted, with a dark background and a light foreground. +Overwrites a theme of the same name in case it exists. ```yaml -Type: System.Boolean +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: None -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -Overwrite +### -ColorPairs > Applicable: SharePoint Online -Overwrites a theme of the same name in case it exists. +Specifies the color pairs of the theme, as a dictionary or hash table of theme slot values. Supports up to 16 color pairs. ```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: None +Type: Microsoft.Online.SharePoint.PowerShell.SpoThemeColorPairPipeBind +Parameter Sets: NewThemeSet +Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -138,11 +176,11 @@ Accept wildcard characters: False > Applicable: SharePoint Online -Specifies the palette of colors in the theme, as a dictionary of theme slot values. +Specifies the palette of colors in the theme, as a dictionary or hash table of theme slot values. ```yaml Type: Microsoft.Online.SharePoint.PowerShell.SpoThemePalettePipeBind -Parameter Sets: (All) +Parameter Sets: LegacyThemeSet Aliases: Required: True @@ -155,6 +193,24 @@ Accept wildcard characters: False ### CommonParameters 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). +### -IsInverted + +> Applicable: SharePoint Online + +Specifies whether the theme is inverted, with a dark background and a light foreground. + +```yaml +Type: System.Boolean +Parameter Sets: LegacyThemeSet +Aliases: None + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ## INPUTS ### Microsoft.Online.SharePoint.PowerShell.SpoThemePipeBind From 7264b9b6e869d866efff7cb8e338b14d6de95a2e Mon Sep 17 00:00:00 2001 From: Rongqi Zhou Date: Tue, 2 Sep 2025 14:23:01 +0800 Subject: [PATCH 2/9] update wording --- .../Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index af0f172f8..5941657ac 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -98,11 +98,11 @@ Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false - $colorPairs = @{ light = @( @{ - foregroundColor = '#00ffff' + accentColor = '#00ffff' backgroundColor = '#fff' }, @{ - foregroundColor = '#fff' + accentColor = '#fff' backgroundColor = '#00ffff' } ) From 9fe1bafe767298263ff57aad8d848970ce63a730 Mon Sep 17 00:00:00 2001 From: Rongqi Zhou Date: Tue, 2 Sep 2025 16:15:35 +0800 Subject: [PATCH 3/9] update new theme colors --- .../Add-SPOTheme.md | 108 +++++++++++++----- 1 file changed, 78 insertions(+), 30 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index 5941657ac..24839d61d 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -18,21 +18,21 @@ Creates a new custom theme, or overwrites an existing theme to modify its settin ## SYNTAX -### LegacyThemeSet +### NewThemeSet ``` Add-SPOTheme [-Identity] - -Palette - -IsInverted + -ColorPairs [-Overwrite] [] ``` -### NewThemeSet +### LegacyThemeSet ``` Add-SPOTheme [-Identity] - -ColorPairs + -Palette + -IsInverted [-Overwrite] [] ``` @@ -47,7 +47,78 @@ You can choose which parameter set to use depending on the legacy or new theme f ## Examples -### Example 1: Add a legacy format theme +### Example 1: Add a new format theme +```powershell +$colorPairs = @{ + light = @( + @{ + accentColor = '#03787C' + backgroundColor = '#ffffff' + }, + @{ + accentColor = '#ffffff' + backgroundColor = '#03787C' + }, + @{ + accentColor = '#E3FFFD' + backgroundColor = '#03787C' + }, + @{ + accentColor = '#03787C' + backgroundColor = '#E3FFFD' + }, + @{ + accentColor = '#FFF9E3' + backgroundColor = '#03787C' + }, + @{ + accentColor = '#03787C' + backgroundColor = '#FFF9E3' + }, + @{ + accentColor = '#03787C' + backgroundColor = '#F5F5F5' + }, + @{ + accentColor = '#242424' + backgroundColor = '#F5F5F5' + }, + @{ + accentColor = '#155473' + backgroundColor = '#ffffff' + }, + @{ + accentColor = '#ffffff' + backgroundColor = '#155473' + }, + @{ + accentColor = '#155473' + backgroundColor = '#E3FFFD' + }, + @{ + accentColor = '#E3FFFD' + backgroundColor = '#155473' + }, + @{ + accentColor = '#FFF9E3' + backgroundColor = '#155473' + }, + @{ + accentColor = '#155473' + backgroundColor = '#FFF9E3' + } + ) +} + +Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs +``` + +### Example 2: Overwrite a new format theme +```powershell +Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs -Overwrite +``` + +### Example 3: Add a legacy format theme 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. ```powershell @@ -85,7 +156,7 @@ Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false > [!NOTE] > 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. -### Example 2: Overwrite a legacy format theme +### Example 4: Overwrite a legacy format theme If you want to update an existing legacy format 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. @@ -93,29 +164,6 @@ If you want to update an existing legacy format theme (to modify some of its col Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false -Overwrite ``` -### Example 3: Add a new format theme -```powershell -$colorPairs = @{ - light = @( - @{ - accentColor = '#00ffff' - backgroundColor = '#fff' - }, - @{ - accentColor = '#fff' - backgroundColor = '#00ffff' - } - ) -} - -Add-SPOTheme -Identity "Custom Cyan" -ColorPairs $colorPairs -``` - -### Example 4: Overwrite a new format theme -```powershell -Add-SPOTheme -Identity "Custom Cyan" -ColorPairs $colorPairs -Overwrite -``` - ## PARAMETERS ### -Identity From b3a42414932278e08a17b032daf23c6914054b8f Mon Sep 17 00:00:00 2001 From: Rongqi Zhou Date: Tue, 2 Sep 2025 16:57:48 +0800 Subject: [PATCH 4/9] make the theme obj format aligned --- .../Add-SPOTheme.md | 73 ++++--------------- 1 file changed, 15 insertions(+), 58 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index 24839d61d..22885b409 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -50,64 +50,21 @@ You can choose which parameter set to use depending on the legacy or new theme f ### Example 1: Add a new format theme ```powershell $colorPairs = @{ - light = @( - @{ - accentColor = '#03787C' - backgroundColor = '#ffffff' - }, - @{ - accentColor = '#ffffff' - backgroundColor = '#03787C' - }, - @{ - accentColor = '#E3FFFD' - backgroundColor = '#03787C' - }, - @{ - accentColor = '#03787C' - backgroundColor = '#E3FFFD' - }, - @{ - accentColor = '#FFF9E3' - backgroundColor = '#03787C' - }, - @{ - accentColor = '#03787C' - backgroundColor = '#FFF9E3' - }, - @{ - accentColor = '#03787C' - backgroundColor = '#F5F5F5' - }, - @{ - accentColor = '#242424' - backgroundColor = '#F5F5F5' - }, - @{ - accentColor = '#155473' - backgroundColor = '#ffffff' - }, - @{ - accentColor = '#ffffff' - backgroundColor = '#155473' - }, - @{ - accentColor = '#155473' - backgroundColor = '#E3FFFD' - }, - @{ - accentColor = '#E3FFFD' - backgroundColor = '#155473' - }, - @{ - accentColor = '#FFF9E3' - backgroundColor = '#155473' - }, - @{ - accentColor = '#155473' - backgroundColor = '#FFF9E3' - } - ) + light = @( + @{ "themePrimary": "#ffffff", "backgroundColor": "#03787C"; }, + @{ "themePrimary": "#E3FFFD", "backgroundColor": "#03787C"; }, + @{ "themePrimary": "#03787C", "backgroundColor": "#E3FFFD"; }, + @{ "themePrimary": "#FFF9E3", "backgroundColor": "#03787C"; }, + @{ "themePrimary": "#03787C", "backgroundColor": "#FFF9E3"; }, + @{ "themePrimary": "#03787C", "backgroundColor": "#F5F5F5"; }, + @{ "themePrimary": "#242424", "backgroundColor": "#F5F5F5"; }, + @{ "themePrimary": "#155473", "backgroundColor": "#ffffff"; }, + @{ "themePrimary": "#ffffff", "backgroundColor": "#155473"; }, + @{ "themePrimary": "#155473", "backgroundColor": "#E3FFFD"; }, + @{ "themePrimary": "#E3FFFD", "backgroundColor": "#155473"; }, + @{ "themePrimary": "#FFF9E3", "backgroundColor": "#155473"; }, + @{ "themePrimary": "#155473", "backgroundColor": "#FFF9E3"; } + ) } Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs From cd32fb555bedf9964740227f4de74d2483aed990 Mon Sep 17 00:00:00 2001 From: Rongqi Zhou Date: Thu, 18 Sep 2025 15:08:12 +0800 Subject: [PATCH 5/9] add for multi-geo tenants --- .../Add-SPOTheme.md | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index 22885b409..c069dc5e2 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -38,32 +38,37 @@ Add-SPOTheme ``` ## DESCRIPTION -The **Add-SPOTheme** cmdlet creates a new theme or updates an existing theme. The color palette and color pairs settings can be passed as either a hash table or a dictionary. +The **Add-SPOTheme** cmdlet creates a new theme or updates an existing theme. The color pairs settings can be passed as a hash table. The color palette settings can be passed as either a hash table or a dictionary. 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. You can choose which parameter set to use depending on the legacy or new theme format you want to add. Please read [Site theme](https://learn.microsoft.com/sharepoint/site-theme) for more about new theme. +> [!NOTE] +> In multi-geo environments, themes added by an administrator in the primary geography are propagated and available across the entire organization. This` Add-SPOTheme` cmdlet is not supported for administrators in satellite geographies. ## Examples ### Example 1: Add a new format theme +In this example, a theme named `"Teal Theme"` is created, with color pair settings that are various shades of teal. + ```powershell $colorPairs = @{ light = @( - @{ "themePrimary": "#ffffff", "backgroundColor": "#03787C"; }, - @{ "themePrimary": "#E3FFFD", "backgroundColor": "#03787C"; }, - @{ "themePrimary": "#03787C", "backgroundColor": "#E3FFFD"; }, - @{ "themePrimary": "#FFF9E3", "backgroundColor": "#03787C"; }, - @{ "themePrimary": "#03787C", "backgroundColor": "#FFF9E3"; }, - @{ "themePrimary": "#03787C", "backgroundColor": "#F5F5F5"; }, - @{ "themePrimary": "#242424", "backgroundColor": "#F5F5F5"; }, - @{ "themePrimary": "#155473", "backgroundColor": "#ffffff"; }, - @{ "themePrimary": "#ffffff", "backgroundColor": "#155473"; }, - @{ "themePrimary": "#155473", "backgroundColor": "#E3FFFD"; }, - @{ "themePrimary": "#E3FFFD", "backgroundColor": "#155473"; }, - @{ "themePrimary": "#FFF9E3", "backgroundColor": "#155473"; }, - @{ "themePrimary": "#155473", "backgroundColor": "#FFF9E3"; } + @{ "accentColor": "#03787C"; "backgroundColor": "#ffffff" } + @{ "accentColor": "#ffffff"; "backgroundColor": "#03787C" } + @{ "accentColor": "#E3FFFD"; "backgroundColor": "#03787C" } + @{ "accentColor": "#03787C"; "backgroundColor": "#E3FFFD" } + @{ "accentColor": "#FFF9E3"; "backgroundColor": "#03787C" } + @{ "accentColor": "#03787C"; "backgroundColor": "#FFF9E3" } + @{ "accentColor": "#03787C"; "backgroundColor": "#F5F5F5" } + @{ "accentColor": "#242424"; "backgroundColor": "#F5F5F5" } + @{ "accentColor": "#155473"; "backgroundColor": "#ffffff" } + @{ "accentColor": "#ffffff"; "backgroundColor": "#155473" } + @{ "accentColor": "#155473"; "backgroundColor": "#E3FFFD" } + @{ "accentColor": "#E3FFFD"; "backgroundColor": "#155473" } + @{ "accentColor": "#FFF9E3"; "backgroundColor": "#155473" } + @{ "accentColor": "#155473"; "backgroundColor": "#FFF9E3" } ) } @@ -71,6 +76,9 @@ Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs ``` ### Example 2: Overwrite a new format theme + +If you want to update an existing new format 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. + ```powershell Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs -Overwrite ``` @@ -170,7 +178,7 @@ Type: Microsoft.Online.SharePoint.PowerShell.SpoThemeColorPairPipeBind Parameter Sets: NewThemeSet Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -188,7 +196,7 @@ Type: Microsoft.Online.SharePoint.PowerShell.SpoThemePalettePipeBind Parameter Sets: LegacyThemeSet Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -209,7 +217,7 @@ Type: System.Boolean Parameter Sets: LegacyThemeSet Aliases: None -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False From dea1a3ff65331c7f665ba5a127e21c50798adcca Mon Sep 17 00:00:00 2001 From: Rongqi Zhou Date: Tue, 23 Sep 2025 16:41:23 +0800 Subject: [PATCH 6/9] update --- .../Add-SPOTheme.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index c069dc5e2..810020f52 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -38,19 +38,18 @@ Add-SPOTheme ``` ## DESCRIPTION -The **Add-SPOTheme** cmdlet creates a new theme or updates an existing theme. The color pairs settings can be passed as a hash table. The color palette settings can be passed as either a hash table or a dictionary. +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. -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. +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. -You can choose which parameter set to use depending on the legacy or new theme format you want to add. Please read [Site theme](https://learn.microsoft.com/sharepoint/site-theme) for more about new theme. +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). > [!NOTE] -> In multi-geo environments, themes added by an administrator in the primary geography are propagated and available across the entire organization. This` Add-SPOTheme` cmdlet is not supported for administrators in satellite geographies. +> 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. ## Examples -### Example 1: Add a new format theme -In this example, a theme named `"Teal Theme"` is created, with color pair settings that are various shades of teal. +### Example 1: ```powershell $colorPairs = @{ @@ -75,16 +74,17 @@ $colorPairs = @{ Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs ``` -### Example 2: Overwrite a new format theme +This example creates a theme named `"Teal Theme"` with color pair settings in various shades of teal. -If you want to update an existing new format 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. +### Example 2: ```powershell Add-SPOTheme -Identity "Teal Theme" -ColorPairs $colorPairs -Overwrite ``` -### Example 3: Add a legacy format theme -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. +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. + +### Example 3: ```powershell $themepalette = @{ @@ -118,17 +118,19 @@ $themepalette = @{ Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false ``` +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. + > [!NOTE] > 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. ### Example 4: Overwrite a legacy format theme -If you want to update an existing legacy format 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. - ```powershell Add-SPOTheme -Identity "Custom Cyan" -Palette $themepalette -IsInverted $false -Overwrite ``` +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. + ## PARAMETERS ### -Identity @@ -171,7 +173,7 @@ Accept wildcard characters: False > Applicable: SharePoint Online -Specifies the color pairs of the theme, as a dictionary or hash table of theme slot values. Supports up to 16 color pairs. +Specifies the theme’s color pairs using a hash table of slot values. Supports up to 16 color pairs. ```yaml Type: Microsoft.Online.SharePoint.PowerShell.SpoThemeColorPairPipeBind From a3a3e3b873801ef67a67a2a0087def8dc0efbf25 Mon Sep 17 00:00:00 2001 From: Rongqi Zhou Date: Tue, 23 Sep 2025 17:08:37 +0800 Subject: [PATCH 7/9] format colors --- .../Add-SPOTheme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index 810020f52..25407b96d 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -54,16 +54,16 @@ Choose the appropriate parameter set based on whether you're working with a lega ```powershell $colorPairs = @{ light = @( - @{ "accentColor": "#03787C"; "backgroundColor": "#ffffff" } - @{ "accentColor": "#ffffff"; "backgroundColor": "#03787C" } + @{ "accentColor": "#03787C"; "backgroundColor": "#FFFFFF" } + @{ "accentColor": "#FFFFFF"; "backgroundColor": "#03787C" } @{ "accentColor": "#E3FFFD"; "backgroundColor": "#03787C" } @{ "accentColor": "#03787C"; "backgroundColor": "#E3FFFD" } @{ "accentColor": "#FFF9E3"; "backgroundColor": "#03787C" } @{ "accentColor": "#03787C"; "backgroundColor": "#FFF9E3" } @{ "accentColor": "#03787C"; "backgroundColor": "#F5F5F5" } @{ "accentColor": "#242424"; "backgroundColor": "#F5F5F5" } - @{ "accentColor": "#155473"; "backgroundColor": "#ffffff" } - @{ "accentColor": "#ffffff"; "backgroundColor": "#155473" } + @{ "accentColor": "#155473"; "backgroundColor": "#FFFFFF" } + @{ "accentColor": "#FFFFFF"; "backgroundColor": "#155473" } @{ "accentColor": "#155473"; "backgroundColor": "#E3FFFD" } @{ "accentColor": "#E3FFFD"; "backgroundColor": "#155473" } @{ "accentColor": "#FFF9E3"; "backgroundColor": "#155473" } From 649fa32a9745f78182b8a4b5ec68449374e31a39 Mon Sep 17 00:00:00 2001 From: RongqiZ <81340450+RongqiZ@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:20:54 +0800 Subject: [PATCH 8/9] Fix markdown formatting for color pairs description --- .../Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index 25407b96d..63cf62376 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -173,7 +173,7 @@ Accept wildcard characters: False > Applicable: SharePoint Online -Specifies the theme’s color pairs using a hash table of slot values. Supports up to 16 color pairs. +Specifies the theme's color pairs using a hash table of slot values. Supports up to 16 color pairs. ```yaml Type: Microsoft.Online.SharePoint.PowerShell.SpoThemeColorPairPipeBind From 788da6c59981c93146b0e66ba473cbf3319bfa9a Mon Sep 17 00:00:00 2001 From: RongqiZ <81340450+RongqiZ@users.noreply.github.com> Date: Thu, 25 Sep 2025 09:08:27 +0800 Subject: [PATCH 9/9] Add site theme doc to related links --- .../Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md index 63cf62376..9b064a201 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOTheme.md @@ -237,3 +237,4 @@ Accept wildcard characters: False ## NOTES ## RELATED LINKS +[Site theme](/sharepoint/site-theme)