I'm trying to deploy my first web part on 2010. I developed a web part using VS2008 and tested it on SP2007.

I copied the CAB to the 2010 server and tried to use PowerShell to install it and got the following error:

PS C:\Users\sa_portalt> Install-SPWebPartPack -LiteralPath "c:\transfer\webparts\redirectwebpart.cab" -Name "RedirectWebPart"
Install-SPWebPartPack : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:22
+ Install-SPWebPartPack <<<<  -LiteralPath "c:\transfer\webparts\redirectwebpart.cab" -Name "RedirectWebPart"
    + CategoryInfo          : InvalidArgument: (:) [Install-SPWebPartPack], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.SharePoint.PowerShell.SPCmdletInstallWebPartPack

What am I doing wrong? Is this the right way to install web parts?


For SharePoint 2010 development I would recommend upgrading to Visual Studio 2010 if possible, as the built-in tools make the whole testing and deployment a lot easier. Also, we name the cab files with the extension .wsp to make it clear that it is a solution package.

Assuming the solution package has been built correctly, the PowerShell script in your post seems to have been scrambled in the process of pasting it. You should be doing something like:

Add-SPSolution c:\transfer\webparts\WebPart.wsp

which will add the solution to your farm (configuration database), then

Install-SPSolution WebPart.wsp -GACDeployment -WebApplication http://server/

to deploy the solution to your web application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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