Tuesday, April 2, 2013

PowerShell - Change Master Page

I had to write a quick PowerShell script to change the Master Page for a SharePoint 2013 site. Thought to share it with the world.



$SiteUrl = "http://mySite1919/sites/MasterTest";
$NewMasterPage = "/_catalogs/masterpage/MasterPage_custom.master";

$SiteWeb = $Site.openweb();
$SiteRelativeUrl = $Site.ServerRelativeUrl.TrimEnd('/');

Write-Host "Site: " $SiteUrl;
Write-Host "Current MasterPage: " $SiteWeb.CustomMasterUrl;

#Site Master Page
$SiteWeb.CustomMasterUrl = $SiteRelativeUrl + $NewMasterPage;
#System Master Page
$SiteWeb.MasterUrl = $SiteRelativeUrl + $NewMasterPage;


Write-Host "New MasterPage: " $SiteWeb.CustomMasterUrl


Microsoft Flow - HTTP REST Call

In this blog post, I will cover what is a workflow and how we can create a workflow using Microsoft Flow that can make HTTP REST calls to br...