I want to get a list of all features in a specific scope using PowerShell. I want to get all activate and inactive features by providing the scope. How can I achieve that?
1 Answer
You can try the next script
$allSiteFeatures = Get-SPFeature | Where-Object { $_.Scope -eq "Site" }
$activeFeatures = Get-SPFeature -Site "http://sitecollectionUrl"
$allSiteFeatures | ForEach-Object {
$active = $false
foreach($feature in $activeFeatures)
{
if($feature.Id.ToString() -eq $_.Id.ToString())
{
$active = $true
}
}
if(!$active)
{
$_.DisplayName
}
}
Greetings