Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Your approch is working and maybe there is a reason doing it this way. can you please give us a reason why your ar not using a sharepoint solution (WSP) to do this? In generall this would be the best practice. Not saying you are doing it wrong. i'm just curious why you went with this approch. Commented Aug 10, 2011 at 14:31
  • In PowerShell you can use $web = Get-SPWeb $url instead of $web = $SPSite.OpenWeb(). Furthermore, you can simply use $web.GetCatalog([Microsoft.SharePoint.SPListTemplateType]::MasterPageCatalog) instead of $MasterPagelist = ($web).Lists |? {$_.Title -eq "Master Page Gallery"}. I have not tested if it is faster, but seems better and is language-indepandent at least. Commented Feb 15, 2018 at 11:04