How to remove orphaned features

How to remove orphaned features

 
Get-SPFeature | ? { $_.Scope -eq $null }
This will give you a complete list of orphaned features.
Obviously, I had a lot of orphaned features on my Development Environment
 
$feature = Get-SPFeature | ? { $_.DisplayName -eq "My_Orphane_Feature" }
$feature.Delete()

You can even use this code to clean all the orphaned features:
Get-SPFeature | ? { !$_.Scope } | % { $_.Delete() }

Comments

Popular posts from this blog

How to Improve Workflow Performance in SharePoint Server 2010

PowerShell Script to Check and Generate Report on Access Rights for a Specific User:

Disable Loopbackcheck using PowerShell