SharePoint site theming: PowerShell cmdlets
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.
For information about how themes are defined and stored, see JSON schema reference.
To run the PowerShell cmdlets for theme management, you must do the following:
- Download and install the SharePoint Online Management Shell. If you already have a previous version of the shell installed, uninstall it first and then install the latest version.
- Follow the instructions at Connect to SharePoint Online PowerShell to connect to your SharePoint tenant.
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.
The following cmdlets are available for managing site themes from PowerShell:
- Add-SPOTheme – Creates a new custom theme, or overwrites an existing theme to modify its settings.
- Get-SPOTheme – Retrieves settings for an existing theme.
- Remove-SPOTheme – Removes a theme from the theme gallery.
- Set-SPOHideDefaultThemes – Specifies whether the default themes should be available.
- Get-SPOHideDefaultThemes – Queries the current SPOHideDefaultThemes setting.