Posts

Showing posts with the label Update Solution with Powershell

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