kwizcom banner advertisement

Delete List Template in SharePoint using PowerShell

Requirement:  Delete a list template in SharePoint

How to delete a list template SharePoint?
To remove list template in SharePoint,
  • Login to your SharePoint site collection (List templates are scoped at site collection level) >> Click on Settings >> Site Settings
  • On Site Settings Page, Click on "List Templates" under Web Designer Galleries (http://yoursite.com/_catalogs/lt)
  • Select the list template to delete and click on "Delete Document" from the ribbon
  • Confirm the prompt to delete custom list template in SharePoint.
    delete list template in sharepoint

Delete list template in SharePoint 2013 using PowerShell
Here is how to delete SharePoint list templates using PowerShell script:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for Site URL and List template name
$SiteURL="http://intranet.crescent.com/sites/sales/"
$ListTemplateName ="Project Health.stp"

#Get Site and List Template Folder objects
$site = Get-SPSite $SiteURL
$ListTemplateFolder = $site.RootWeb.GetFolder("_catalogs/lt")

#Find the Specific List template and delete
$ListTemplate = $ListTemplateFolder.Files | Where-Object { $_.Name -eq $ListTemplateName }

if($ListTemplate)
 {
    $ListTemplate.Recycle()
    #To permanently delete, call: $ListTemplate.delete();
    write-output "Deleted List template!" 
 }
Delete List Template in SharePoint using PowerShell Delete List Template in SharePoint using PowerShell Reviewed by Salaudeen Rajack on February 02, 2014 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.