Enumerating Site Templates Via PowerShell

8 Dec

When I’m working on an extremely large SharePoint deployment, getting small code changes deployed to my dev environment to test things can be a slow process.

I’ve started using PowerShell very frequently to verify the expected return from different objects before writing the code.

Here’s how you can enumerate all the site templates installed:

<p>[System.Reflection.Assembly]::LoadFrom</p><blockquote><p>    (<span class="str">"..12 hive..ISAPIMicrosoft.SharePoint.dll"</span>);</p></blockquote>
$globalAdmin = New-Object &ndash;TypeName 
    <span class="str">"Microsoft.SharePoint.Administration.SPGlobalAdmin"</span>;
$webTemplates = $globalAdmin.VirtualServers[0].GetWebTemplates(<span class="str">"1033"</span>);
$webTemplates | Select Name, Description;<br /><br /><br />

Tweet about this on TwitterShare on Google+Share on FacebookShare on RedditEmail this to someoneShare on LinkedInShare on StumbleUpon

Leave a Reply

Your email address will not be published. Required fields are marked *