Skip to content

Instantly share code, notes, and snippets.

@premsh
Created April 15, 2013 22:04
Show Gist options
  • Save premsh/5391643 to your computer and use it in GitHub Desktop.
Save premsh/5391643 to your computer and use it in GitHub Desktop.
Farm Solution Deployment PowerShell Command
Add-PSSnappin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$SolutionPackageName = "name.wsp"
$SolutionPackagePath = "projectname\name.wsp"
$solution = Get-SPSolution | where-object {$_.name -eq $SolutionPackageName}
if($solution -ne $null)
{
if($solution.Deployed -eq $true)
{
Uninstall-SPSolution -Identity $SolutionPackageName -Local -Confirm:$false
}
Remove-SPSolution -Identity $SolutionPackageName -Confirm:$false
}
Write-Host "Installing Solution..."
Add-SPSolution -LiteralPath $SolutionPackagePath
Install-SPSolution -Identity $SolutionPackageName -Local -GACDeployment
Write-Host "Deployment Complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment