Detect Installed Theme
This script will detect install theme for particular site
Summary
Get currently installed theme in SharePoint site
# Make sure necessary modules are installed
# PnP PowerShell to get access to M365 tenent
Install-Module PnP.PowerShell
Connect-PnPOnline -Url $siteURL
$siteURL = "https://tenent.sharepoint.com/sites/Dataverse"
$web = Get-PnPWeb -Includes PrimaryColor
$themes = Get-PnPTenantTheme
$selectedTheme = $themes | where {$_.Palette.themePrimary -eq $web.PrimaryColor}
if($selectedTheme.Count -eq 1){
Write-Host "Installed Theme Name:"$selectedTheme.Name -ForegroundColor Green
}
else{
Write-Host "Theme does not found" -ForegroundColor red
}Contributors
| Author(s) |
|---|
| Dipen Shah |
Disclaimer
THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
Tool documentation & references
- Want to learn more about PnP PowerShell and the cmdlets
Check out the PnP PowerShell site to get started and for the reference to the cmdlets.