locked
How do I determine the FeatureFolderName of a Feature? RRS feed

  • Question

  • I am trying to uninstall some features from my MOSS 2007. I understand that the follwing command will uninstall a feature: Uninstall-SPFeature FeatureFolderName.

    However, I don't know how to determine the FeatureFolderName.

    Can someone help me out with this? Thanks in advance!

    • Edited by Mike Walsh FIN Saturday, January 8, 2011 7:59 AM 2020 (sic) info removed. This is a pre-2010 forum
    Saturday, January 8, 2011 12:31 AM

Answers

  • You could use one of the nice tool in codeplex

    http://spfeaturemanager.codeplex.com/

     

    How to get folder name.

     

    Approach1

    if you have WSP file then unzip the wsp.So you could know it from feature.xml

    Approach2

    Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES and try to figure out from names.

    Approach 3

    Following code will create a list of csv file for you

    using (StreamWriter writer = File.CreateText("MyFeatureList.csv")) 

      foreach (string folder in Directory.GetDirectories( 

        @"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\FEATURES")) 

      { 

        string featureFile = Path.Combine(folder, "feature.xml"); 

        if (File.Exists(featureFile)) 

        { 

          using (XmlReader reader = XmlReader.Create(featureFile)) 

          { 

            reader.MoveToContent(); 

            string id = reader.GetAttribute("Id"); 

            string title = reader.GetAttribute("Title");

            string scope = reader.GetAttribute("Scope");

            writer.WriteLine("{0}\t{1}\t{2}\t{3}",

              new DirectoryInfo(folder).Name, id, title, scope); 

          } 

        } 

      } 

    }

    • Marked as answer by Leoyi Sun Friday, January 21, 2011 7:10 AM
    Sunday, January 9, 2011 7:07 AM