あなたは、あなたが発見したものと全く同じですし、私も同じことに遭遇しました。本質的には、あなたのComposed Lookのフィールド値と一致するように "Current" Composed Lookを更新する必要がありますあなたはApplyTheme()およびMasterUrl/CustomMasterUrlを介して印加されること:
#Set URL variables
$urlForSite = "https://YourSharePointSite/sites/test"
$themeUrl = "/sites/test/_catalogs/theme/15/YourTheme.spcolor"
#Get the site
$site = Get-SPSite $urlForSite
$relativeUrl = $site.ServerRelativeUrl
if ($relativeUrl -eq "/") {
$relativeUrl = "" #make sure it doesn't end in a slash
}
#Update the "Current" entry if there is one
$designList = $site.GetCatalog([Microsoft.SharePoint.SPListTemplateType]::DesignCatalog)
$camlQ = New-Object Microsoft.SharePoint.SPQuery
$camlQ.Query = "<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Current</Value></Eq></Where>"
$items = $designList.GetItems($camlQ)
if ($items.Count -eq 1) {
$item = $items[0]
$item["MasterPageUrl"] = $relativeUrl + "/_catalogs/masterpage/seattle.master"
$item["ThemeUrl"] = $themeUrl
#Include these if you need to
#$item["ImageUrl"] = ?
#$item["FontSchemeUrl"] = ?
$item.Update()
}
#Dispose because you know you should
$site.Dispose()
私はまた、あなたがAPPLたときにことがわかりましたとき/プレビューを生成した後DesignPreviewSaveDataクラスを使用するように見えるUIで、「外観を変更する」オプション経由屋で構成されるルック: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.utilities.designpreviewsavedata_properties.aspx
このプレビューは、SPWebのに追加されている2つのプロパティがあります発生した場合プロパティバッグ:
- DesignPreviewLayoutUrl
- DesignPreviewThemedCssFolderUrl
私はこれらのプロパティを更新する必要はありませんでしたが、あなたが得ることを見出し
UIプロセスと同じ手順を実行したいだけです。
コミュニティが手伝ってくれるようにコードとスクリーンショットを投稿してください。 – gms0ulman