function GetWebTheme($web) { [string]$thmxURL = [Microsoft.SharePoint.Utilities.ThmxTheme]::GetThemeUrlForWeb($web); [Microsoft.SharePoint.Utilities.ThmxTheme] $mytheme = [Microsoft.SharePoint.Utilities.ThmxTheme]::Open($web.Site, $thmxURL); Write-Host "" Write-Host "Current SPWeb URL:", $web.URL Write-Host "Current Theme:", $mytheme.Name, "[", $thmxURL, "]"; Write-Host "" } function SetWebTheme($web, $themeName) { [string]$themeUrl = “/sites/ASP-PHP/_catalogs/theme/” + $themeName + “.thmx” [Microsoft.SharePoint.Utilities.ThmxTheme]::SetThemeUrlForWeb($web, $themeUrl) $web.Update() Write-Host " -------------------------------------------- " Write-Host "" Write-Host "Current SPWeb URL:", $web.URL Write-Host "New Theme to apply:", $themeName, "[", $themeUrl, "]"; Write-Host "" Write-Host " -------------------------------------------- " } [string]$MyWebURL = "http://ch0015271v/sites/ASP-PHP/"; [string]$newWebTheme = "ASP-PHP" $myweb = Get-SPWeb $MyWebURL; cls GetWebTheme $myweb SetWebTheme $myweb $newWebTheme