-
Notifications
You must be signed in to change notification settings - Fork 187
support to add theme v2 for Add-SPOTheme command #1013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
bec4e6e
7264b9b
9fe1baf
b3a4241
cd32fb5
dea1a3f
a3a3e3b
649fa32
788da6c
7178aa1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,22 +18,73 @@ Creates a new custom theme, or overwrites an existing theme to modify its settin | |
|
|
||
| ## SYNTAX | ||
|
|
||
| ### NewThemeSet | ||
| ``` | ||
| Add-SPOTheme [-Identity] <SpoThemePipeBind> -Palette <SpoThemePalettePipeBind> -IsInverted <Boolean> | ||
| [-Overwrite] [<CommonParameters>] | ||
| Add-SPOTheme | ||
| [-Identity] <SpoThemePipeBind> | ||
| -ColorPairs <SpoThemeColorPairPipeBind> | ||
| [-Overwrite] | ||
| [<CommonParameters>] | ||
| ``` | ||
|
|
||
| ## DESCRIPTION | ||
| ### LegacyThemeSet | ||
| ``` | ||
| Add-SPOTheme | ||
| [-Identity] <SpoThemePipeBind> | ||
| -Palette <SpoThemePalettePipeBind> | ||
| -IsInverted <Boolean> | ||
| [-Overwrite] | ||
| [<CommonParameters>] | ||
| ``` | ||
|
|
||
| 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 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. | ||
|
||
|
|
||
| ## 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 | ||
| > [!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 | ||
|
|
||
| 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 new format theme | ||
|
||
| In this example, a theme named `"Teal Theme"` is created, with color pair settings that are various shades of teal. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. description comes AFTER the example #Closed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update other examples too
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
| ```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 | ||
|
|
||
| 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 | ||
| ``` | ||
|
|
||
| ### 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 | ||
| $themepalette = @{ | ||
|
|
@@ -70,9 +121,9 @@ 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 4: 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 | ||
|
|
@@ -98,34 +149,34 @@ 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 | ||
| Position: Named | ||
|
|
@@ -138,14 +189,14 @@ 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 | ||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
|
|
@@ -155,6 +206,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: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ## INPUTS | ||
|
|
||
| ### Microsoft.Online.SharePoint.PowerShell.SpoThemePipeBind | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cmdlet #Closed