Today I tried to deploy a solution through PowerShell with the command:

Install-SPSolution–Identity helpdesk.wsp–WebApplication http://myserver/-GACDeployment

I then got the following error:

Install-SPSolution : This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.

At C:\Users\Administrator\Downloads\HelpDeskTemplate\HelpDesk\installsolutions.ps1:68 char:4

+    Install-SPSolution –Identity helpdesk.wsp –WebApplication http://myserver/ -G …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo          : InvalidData: (Microsoft.Share…InstallSolution:SPCmdletInstallSolution) [Install-SPSolution], SPException

+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletInstallSolution

A bit silly of course. This .wsp contains only a site definition and with the above command I was trying to deploy the solution to a specific SharePoint application. As this template is used within Central Admin to create a new site collection this should fail.

The solution

Run the command without the WebApplication switch:

Install-SPSolution–Identity helpdesk.wsp -GACDeployment