0

When viewing the List Template gallery I can see my custom (deployed via wsp) list template. I cannot see it when using powershell to display the web (sub web or root web)'s ListTemplates.

$web.ListTemplates["myTemplate"]

Returns null, for example.

Any reasons this might be happening?

1 Answer 1

1

To get custom list templates, use following script:

$site = Get-SPSite <YOURSITE>
$web = $site.AllWebs[0]
$listTemplates = $site.GetCustomListTemplates($web)
4
  • I tried this and it actually returned nothing :( -- my only deviation was using $web.Site.GetCustomListTemplates($web) instead of creating an spsite object
    – ferr
    Apr 20, 2015 at 13:29
  • Is your Custom List Template derived from one of default list templates like "Discussion Board"? Or it is derived from "Custom List" list template?
    – 404
    Apr 21, 2015 at 5:30
  • the parent content type is Item (0x01). sorry- i may have mis-phrased what this is- it's a content type (but it should be available in web.ListTemplates, no?)
    – ferr
    Apr 22, 2015 at 13:21
  • What's so confusing to me is that I can see other custom content types in web.ListTemplates (via powershell) which have the same parent content type of 0x01 and same deployment procedures, etc..
    – ferr
    Apr 22, 2015 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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