Posts

Showing posts with the label Install WSP with Powershell

Install WSP 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..." -foregroundcolor Green if($solution.Deployed -eq $true) { Write-Host "Uninstalling Solution..." -foregroundcolor red Uninstall-SPSolution -Identity $SolutionPackageName -Local -Confirm:$false Write-Host "Uninstallation Done..." -foregroundcolor Yellow } Write-Host "Removing Solution..." -foregroundcolor red Remove-SPSolution -Identity $SolutionPackageName -Confirm:$false Write-Host "Solution Removed..." -foregroundcolor Yellow } Write-Host "Adding Solution..." -foregroundcolor red Add-SPSolution -LiteralPath $Sol

Install WSP 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..." -foregroundcolor Green if($solution.Deployed -eq $true) { Write-Host "Uninstalling Solution..." -foregroundcolor red Uninstall-SPSolution -Identity $SolutionPackageName -Local -Confirm:$false Write-Host "Uninstallation Done..." -foregroundcolor Yellow } Write-Host "Removing Solution..." -foregroundcolor red Remove-SPSolution -Identity $SolutionPackageName -Confirm:$false Write-Host "Solution Removed..." -foregroundcolor Yellow } Write-Host "Adding Solution..." -foregroundcolor red Add-SPSol