Enumerating Site Templates Via PowerShell
8. December 2009 02:29

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:

[System.Reflection.Assembly]::LoadFrom

("..12 hive..\ISAPI\Microsoft.SharePoint.dll");

$globalAdmin = New-Object –TypeName 
    "Microsoft.SharePoint.Administration.SPGlobalAdmin";
$webTemplates = $globalAdmin.VirtualServers[0].GetWebTemplates("1033");
$webTemplates | Select Name, Description;




Tags: Comments (0) | Permalink
Comments are closed