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.
Getting started
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.
Site theme cmdlets
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.
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應