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