using powershell ISE need to run as Administrator
=====================================
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$WEB_APP = "http://xxxx"
$SITE_URL = "http://xxxx/sca"
$SolutionPath = "D:\Sharepoint Applications\xxxsca.wsp"
$Features = @("xxxsca")
Write-Host "Adding solution:" $SolutionPath
Add-SPSolution -LiteralPath $SolutionPath | Out-Null
Write-Host "Solution added successfully."
Write-Host
$SolutionPackage = Get-Item -LiteralPath $SolutionPath
Write-Host "Deploying solution:" $SolutionPackage.Name
Install-SPSolution -Identity $SolutionPackage.Name -GACDeployment -WebApplication $WEB_APP
$Solution = Get-SPSolution -Identity $SolutionPackage.Name
while ($Solution.JobExists) {
Start-Sleep -Seconds 10
}
Write-Host "Solution deployed successfully."
Write-Host
foreach ($featureName in $Features)
{
Write-Host "Enabling feature:" $featureName
Enable-SPFeature -Identity $featureName -Url $SITE_URL
Write-Host "Feature enabled successfully."
Write-Host
}
Read-Host "Finished. Press Enter to exit"