保持简单!
枚举当前网站集中的所有网站;
$collection = Get-SPSite http://localhost/
foreach ($web in $collection.AllWebs) {
$web | Select-Object -Property Title, Url, WebTemplate
$web.Dispose()
}
$collection.Dispose()
与每个站点/子站点关联的标题、网址和模板。此处提供了完整的模板列表。
我编写了一个脚本来显示您网站和网络中的所有可用模板;
$site = Get-SPSite http://localhost/
$web = $site.OpenWeb("")
Write-Host "Site: " + $site.id
Write-Host "Web: " + $web.id
$web.WebTemplate | Format-Table title, id -AutoSize
$template = $web.GetAvailableWebTemplates(1033)
Write-Host "Template: " + $template
$web.Dispose()
$site.Dispose()
模板存储在 12 / 14 hive 下;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\
布局样式表位于;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES
修改 CSS 关联可以用 Power Shell 来完成;
$web = Get-SPWeb http://localhost/
$web.AlternateCssUrl = "http://localhost/_layouts/styles/yourstyles.css"
$web.AllProperties["__InheritsAlternateCssUrl"] = $True
$web.Update()
另一种方法是将声明性标签添加到您的母版页中;
<SharePoint:CssRegistration Name="/_styles/yourstyles.css" runat="server" EnableCssTheming="true" After="true"/>