Using SP 2013.

I have created a site definition in Visual Studio 2012.

Deployed that as a solution.

From the UI I can create a site and select the template I created.

However when I go into PowerShell and call GetAvailableTemplates on the root web, its not there?

For the site I created (from my site def) I go into PowerShell and get SPWeb.WebTemplate which is empty, SPWeb.WebTemplateID contains the ID, which in my case in 10001

If I use SharePoint Manager that does actually show the name of the template. Weird.

If I go into Page Layouts and Site Settings, set to only use my Site Template (which is obviously in the list) ... going back to PowerShell and calling GetAvailableWebTemplates() returns nothing...

I've read that it could be down to caching, but I don't think that affects Powershell ... i did an IIS reset anyway.


Well, after restarting SQL, IIS nothing seemed to help. So I restarted the box and bingo.
Powershell is finding my template.

Love SharePoint!

  • 1
    Wonder if it was caching something (or lack thereof). Glad to hear it is working now for you though. – MAllen22842 Aug 29 '13 at 17:22
  • It was caching yes. Although the restart was a temporary solution until i deployed the site def again. I found this and wrote my own little PowerShell cmdlet - which has worked. scle.me/17pKGmc – SteveCl Aug 30 '13 at 7:32

Have specifically you tried the following:


That command should return back all of the globally installed site templates.

get-spwebtemplate "STS*"

That command returns specific details for the team site templates. And you can do other filters like that for the other "types" of templates.

  • Yep - tried that, should have said. It's not listed in there either – SteveCl Aug 28 '13 at 16:14
  • I have just stuck a bit of C# in a page to output the templates ... SPWebTemplateCollection temps = SPContext.Current.Web.GetAvailableWebTemplates(1033); and it is listed. But not in PowerShell? – SteveCl Aug 28 '13 at 16:23
  • You don't have some sort of invoke command that is pointing to a different server / environment? – MAllen22842 Aug 28 '13 at 17:54
  • nope, certainly not. i've done this a 100 times before in SP2010! honest! – SteveCl Aug 28 '13 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.