Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.03 KB

File metadata and controls

37 lines (28 loc) · 1.03 KB

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 
}

[!INCLUDE More about PnP PowerShell]


Contributors

Author(s)
Dipen Shah

[!INCLUDE DISCLAIMER]