2

how to get the features belongs to a wsp file in sharepoint 2013 i deployed a farm solution there is any option to get features related to this farm solution using powershell

2 Answers 2

4
$name = "<name of solution package>"
$sol = Get-SPSolution $name -ErrorAction SilentlyContinue
foreach ($grp in Get-SPFeature | where {$_.SolutionID -eq $sol.id} | Group-Object SolutionId) {
    Write-Host $sol.Name '(ID:' $sol.ID '), Count:' $grp.Count
    foreach ($fd in $grp.Group | sort DisplayName ) {
        Write-Host $fd.DisplayName '-' $fd.Id '(' $fd.Scope ')'
    }
    Write-Host
}
3
  • i will run above script after i add the solution package to sharepoint farm?
    – adilahmed
    Commented Dec 21, 2016 at 5:51
  • Hi there is any option it show which feature is activated?
    – adilahmed
    Commented Dec 21, 2016 at 6:33
  • Yes, after the WSP is deployed and you can use '(Get-SPFeature -Identity <FEATURE> -ErrorAction SilentlyContinue -Farm/-WebApplication/ -Site/-Web ) -ne $null' to check if feature is activated Commented Dec 27, 2016 at 21:09
1

Get feature list from farm solution

$packageName = "sharepointprojectfarm.wsp"
$solId = (Get-SPSolution $packageName).Id
Get-SPFeature | where {$_.solutionId -eq $solId}|select DisplayName, Scope

List all farm solutions with features (got from: http://bramdejager.wordpress.com/2012/03/13/get-features-grouped-by-solution-package/)

foreach ($grp in Get-SPFeature | Group-Object SolutionId) {
    $sol = Get-SPSolution -Identity $grp.Name -ErrorAction "Continue"
    Write-Host $sol.Name '(ID:' $grp.Name '), Count:' $grp.Count -ForegroundColor Blue
    foreach ($fd in $grp.Group | sort DisplayName ) {
        Write-Host $fd.DisplayName '(' $fd.Scope ')'
    }
    Write-Host

}

Read more: http://m.mypowershell.webnode.sk/news/get-features-list-from-wsp-solution/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.