To get a list of Site collection features:
Get-SPSite http://sharepoint2010 | % { $results = @() Get-SPFeature -Site $_ -Limit All | % { $feature = $_; $featuresDefn = (Get-SPFarm).FeatureDefinitions[$_.ID]; $cc = [System.Globalization.CultureInfo]::CurrentCulture; $obj = New-Object PSObject; $obj | Add-Member NoteProperty Title $($featuresDefn.GetTitle($cc)); $obj | Add-Member NoteProperty Hidden $($feature.Hidden); $results += $obj; } $results | FT -auto; }
To get a list of features for a sub site:
Get-SPWeb http://sharepoint2010/subsite | % {
$results = @()
Get-SPFeature -Web $_ -Limit All | % {
$feature = $_;
$featuresDefn = (Get-SPFarm).FeatureDefinitions[$_.ID];
$cc = [System.Globalization.CultureInfo]::CurrentCulture;
$obj = New-Object PSObject;
$obj | Add-Member NoteProperty Title $($featuresDefn.GetTitle($cc));
$obj | Add-Member NoteProperty Hidden $($feature.Hidden);
$results += $obj;
}
$results | FT -Auto;
}
Shows both hidden and non-hidden features
Thanks to Joe Rodgers (blogs.msdn.com/b/josrod/archive/2013/01/04/
powershell-to-list-activated-features-for-a-site-and-web.aspx)
No comments:
Post a Comment