編輯

共用方式為


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:

  1. 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.
  2. 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:

See also