Update Solution with Powershell

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

$SolutionPackageName = "MySolution.wsp"

$SolutionPackagePath = "C:\PowershellSetup\MySolution.wsp"

Write-Host "Checking Solution exist or not..." -foregroundcolor Yellow

$solution = Get-SPSolution | where-object {$_.Name -eq $SolutionPackageName}
if($solution -ne $null)
{
Write-Host "Solution Found & Updating Solution..." -foregroundcolor Green
Update-SPSolution -Identity $SolutionPackageName -LiteralPath $SolutionPackagePath -Local -GACDeployment -Force
Write-Host "Solution Updated..." -foregroundcolor Yellow
}

Write-Host "Solution Updation Complete." -foregroundcolor Green

Comments

Popular Posts

SharePoint Interview Questions and Answers

Download Infopath Form Templates

How to get current logged user information using JavaScript ?

Steps to set Form based authentication (FBA) for SharePoint 2010

SharePoint Interview Questions and Answers II

Get List Items - JavaScript

Cross Site List Rollup Web Part for SharePoint 2010

Hide Recently Modified Items

Change Language for current user with JSOM in SharePoint Online

SharePoint 2010 CSS Chart