Friday, August 7, 2015

How to Save List as a Template using PowerShell in SharePoint

Requirement: Save SharePoint list as a template using PowerShell

PowerShell Script to save list as a template:

#Add SharePoint Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue 

#Configuration parameters
$ListName="Parent Projects"
$TemplateName="Parent Project Template"
$TemplateDescription="Crescent Inc. Parent Project List Template"
$SaveData = $true

#Get the Web and List objects
$Web = Get-SPWeb $WebURL
$List = $Web.Lists[$ListName]

#Save List as Template
$List.SaveAsTemplate($TemplateFileName, $TemplateName, $TemplateDescription, $SaveData)
Write-Host "List Saved as Template!"
save list as template sharepoint 2013 using powershell

Now,  You can create a new list instance from the template saved: Create List from List Template in SharePoint using PowerShell

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...