Detect theme installed in SharePoint 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
}
Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell
The way you login into PnP PowerShell has changed please read PnP Management Shell EntraID app is deleted : what should I do ?
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.