PowerShell : Install as Farm Feature

%3CLINGO-SUB%20id%3D%22lingo-sub-292303%22%20slang%3D%22en-US%22%3EPowerShell%20%3A%20Install%20as%20Farm%20Feature%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-292303%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20know%20if%20a%20farm%20solution%20needs%20to%20be%20installed%20and%20be%20activated%20as%20a%20farm-scoped%20feature%20(This%20WSP%20should%20not%20be%20found%20in%20Site%20collection's%20solution%20gallery)%2C%20what%20would%20be%20PowerShell%20looks%20like%20targeting%20the%20SP%202013%20On-premise%20environment%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20the%20standard%20PowerShell%20script%20for%20farm%20solution%20deployment%20below%3A%20but%20not%20sure%20where%20to%20change%2Fwhich%20parameter%20to%20add%2Fremove%20for%20the%20above%20scenario.%20Or%20should%20use%20a%20totally%20different%20commands%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdd-SPSolution%20%E2%80%9CYour%20WSP%20Location%E2%80%9D%5C%E2%80%9DYour%20WSP%20Name%E2%80%9D.wsp%3C%2FP%3E%3CP%3EInstall-SPSolution%20%E2%80%93Identity%20%22WSP%20Name%22.wsp%20%E2%80%93WebApplication%20%22Site%20Url%22%20%E2%80%93GACDeployment%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20someone%20can%20help%20to%20direct%20me%20to%20relevant%20answer%20around%20this%20would%20be%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-296882%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20%3A%20Install%20as%20Farm%20Feature%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-296882%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F11066%22%20target%3D%22_blank%22%3EDjavan%20ROA%3C%2FA%3E%3C%2FP%3E%3CP%3EThis%20was%20helpful.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-293914%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20%3A%20Install%20as%20Farm%20Feature%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-293914%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EIf%20your%20solution%20package%20(wsp%20file)%20has%20no%20WebApplication%20scoped%20features%20included%20you%20should%20be%20fine%20running%20the%20same%20command%20without%20the%20%22%3CSPAN%3E%E2%80%93WebApplication%22%20argument.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20case%20your%20package%20has%20at%20least%20one%20WebApplication%20scoped%20feature%20included%20with%20your%20farm%20scoped%20feature%20you%20will%20not%20be%20able%20to%20install%20the%20package%20without%20targeting%20a%20WA.%20To%20achieve%20this%20you%20will%20need%20to%20build%20a%20separate%20package%20for%20your%20farmed%20scoped%20feature.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hello

 

I would like to know if a farm solution needs to be installed and be activated as a farm-scoped feature (This WSP should not be found in Site collection's solution gallery), what would be PowerShell looks like targeting the SP 2013 On-premise environment?

 

I have the standard PowerShell script for farm solution deployment below: but not sure where to change/which parameter to add/remove for the above scenario. Or should use a totally different commands

 

Add-SPSolution “Your WSP Location”\”Your WSP Name”.wsp

Install-SPSolution –Identity "WSP Name".wsp –WebApplication "Site Url" –GACDeployment

 

if someone can help to direct me to relevant answer around this would be appreciated.

2 Replies
Highlighted

Hi,

If your solution package (wsp file) has no WebApplication scoped features included you should be fine running the same command without the "–WebApplication" argument.

In case your package has at least one WebApplication scoped feature included with your farm scoped feature you will not be able to install the package without targeting a WA. To achieve this you will need to build a separate package for your farmed scoped feature.

 

Highlighted

Thanks Djavan ROA

This was helpful.