You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/spo-apply-site-theme/README.md
+85-2Lines changed: 85 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,11 @@
4
4
5
5
## Summary
6
6
7
-
Apply a theme to a specific SharePoint site without adding a tenant theme that would be available for all sites through the "Change the look" menu.
7
+
Apply a theme to a specific SharePoint site without adding a tenant theme that would be available for all sites through the "Change the look" menu. This sample is available in both PnP PowerShell and CLI for Microsoft 365.
8
8
9
-

9
+
Example of applying a custom theme to a SharePoint site using CLI for Microsoft 365:
10
+
11
+

10
12
11
13
12
14
# [PnP PowerShell](#tab/pnpps)
@@ -71,6 +73,86 @@ Disconnect-PnPOnline
71
73
```
72
74
[!INCLUDE [More about PnP PowerShell](../../docfx/includes/MORE-PNPPS.md)]
73
75
76
+
# [CLI for Microsoft 365](#tab/cli-m365-ps)
77
+
78
+
```powershell
79
+
[CmdletBinding(SupportsShouldProcess = $true)]
80
+
param(
81
+
[Parameter(Mandatory, HelpMessage = "SharePoint site URL to apply the theme")]
82
+
[string]$SiteUrl,
83
+
84
+
[Parameter(Mandatory, HelpMessage = "Path to theme JSON file or inline JSON string")]
85
+
[string]$ThemeJson,
86
+
87
+
[Parameter(HelpMessage = "Unique name for the temporary theme")]
0 commit comments