Kategoriarkiv: Feature

Remove SharePoint feature witch name starts with… using powershell

This is how to search for features which display name starts with the given parameter (in this case it would list features which started with MyFeature).

EDIT: You can also find features using GUID instead with the following script:

This will remove all those features which are found using the previous script.

Sometimes (especially in SharePoint 2013), retracting wsps aren’t done properly (by SharePoint that is), and you might get errors when you are trying to reinstall a retracted wsp. After you have retracted a wsp, if the features in that wsp can still be found by Get-SPFeature in PowerShell, and/or you get an error message installing the wsp that “A feature with ID <guid> has already been installed in this farm.”, you might have to manually remove some of the resources yourself. These steps often work for me.

  1. Retract and remove wsp from server.
  2. Run powershell script above to check if the features of the wsp are still installed.
  3. If there are still features installet, delete them from the SPFarm manuall with the following command:

    This only works with single results, so make sure you get only one feature in variable $f Before deleting.

  4. Remove feature folders from the hive (for example C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES”
  5. Remove any references in the assembly. In SP2010 (and earlier perhaps), the assembly is located at C:\Windows\assembly, and for SP2013, you can find it at C:\Windows\Microsoft.NET\assembly\GAC_MSIL.
  6. Restart the SharePoint Timer Service (Found in Services)
  7. Restart IIS (cmd “iisreset /noforce”)