Delete a master page in SharePoint using PowerShell
March 17, 2011 Leave a comment
Had one of my group approach me today inquiring about deleting a master page from a site collection using PowerShell. Quick and simple way to do it…
1: $web = Get-SPWeb "http://prototype"
2: $lib = $web.GetFolder("_catalogs/masterpage")
3: $file = $lib.Files["v4_copy(1).master"];
4: $file.Delete();
5: $web.dispose();
So I thought I would share. Enjoy!



