SharePoint PowerShell Script Set Custom MasterPage Url

在SharePoint 项目中使用自定义母版页,在部署或者发布项目版本的时候需要设置母版页,使用该脚本可以进行初始化设置。

$site = get-spsite(http://server);

$web = $site.RootWeb;

$web.Files[0].delete();

$web.CustomerMasterUrl = "/_catalogs/masterpage/custom.master";

$web.update();

 

 

 

posted on 2011-01-17 23:28  张大明  阅读(235)  评论(0编辑  收藏  举报

导航