Hi,
After our SP2013 farm migration, I know that all our solutions will get undeployed and I want a quick way to redeploy them.
Some of them are deployed globally and some others for specific sites.
So, I'd like a script that will recognize that and redeploy them accordingly.
In https://www.sharepointdiary.com/2015/04/deploy-multiple-solutions-in-sharepoint-using-powershell.html, I see the following script:
#Deploy all installed solutions in the farm
Get-SPSolution | ForEach-Object { if (!$.Deployed) {
If ($.ContainsWebApplicationResource -eq $False) { #Globally deployed
Install-SPSolution -Identity $ -GACDeployment
}
else {#Localy deployed
Install-SPSolution -Identity $ -AllWebApplications -GACDeployment
}
}
}
which I think it's not correct in the case that I have a specific site.
For my testings, ps command must be
Install-SPSolution -Identity $_ -WebApplication $webAppName -GACDeployment
Could you help me finding webAppName modifying the script?
And two more things:
a) Do I have to wait (adding a sleep interval for example) until each solution gets deployed?
b) There is also -force option in install-spsolution. Does it make sense if I use it?
Pardon my ignorance but I'm not familiar with PS.
Thank you,
Nikos