Sunday, February 2, 2014

Delete List Template in SharePoint 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
$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 }

    #To permanently delete, call: $ListTemplate.delete();
    write-output "Deleted List template!" 

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...