Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.