SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the code below to create document libraries, but I need to set the "Document template" value to "Web part page". I can list the document templates using $spWeb.DocTemplates - but how can I set the value using PowerShell?

$spWeb = Get-SPWeb -Identity <url>
$listTemplate = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary
$spWeb.Lists.Add("Listname","List description", $listTemplate)
share|improve this question
up vote 1 down vote accepted

Check out my answer here: Set the Document Template of a Document Library programmatically

I think you can easily convert code provided there to PowerShell (if not let me know). Also be sure to read additional info.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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