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();

原文地址:https://www.cnblogs.com/dexter2003/p/1937844.html