SharePoint 2010

Power of PowerShell – How to Deploy WSP


This post gives insight on How PowerShell can be sued to “To deploy WSP on SharePoint 2010”.

a. First Get the solution

       $solution = Get-SPSolution | where-object {$_.Name -eq $SolutionName}

b. Now check if Solution is Installed
     if ($solution -ne $null)

c. If installed, check if Deployed

    if($solution.Deployed -eq $true)

d. If Deployed then Un-install first

   Uninstall-SPSolution –Identity $SolutionName -Confirm:$false

e. Then Remove

      Remove-SPSolution –Identity $SolutionName -Confirm:$false -Force

f. Now Add and Install  solution

  Add-SPSolution $SolutionPath     

  Install-SPSolution –Identity $SolutionName -GACDeployment -force

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s