Sharepoint - Update-SPSolution does not Deploy Solution

Every time that I have tried to use use the Update-SPSolution command it never works the way I think it should so instead, I always use the deactivate-retract-delete-add-deploy-activate approach just as if it were a new solution.

Per TechNet : "The Update-SPSolution cmdlet upgrades a deployed SharePoint solution in the farm. Use this cmdlet only if a new solution contains the same set of files and features as the deployed solution. If files and features are different, the solution must be retracted and redeployed by using the Uninstall-SPSolution and Install-SPSolution cmdlets, respectively."

There are more details on MSDN as well


Get-SPSolution returns an array of SPSolutions added to the farm. You can compare a solution's name or GUID (SolutionID) to your solution and check the Deployed property to see if it's currently deployed.

For example:

Get-SPSolution -Identity "intranet.publishing.wsp" | select deployed, lastoperationresult

This will retrieve any solutions called "intranet.publishing.wsp" and if it exists display its Deployed and LastOperationResult values.


What's the scenario here? Are you adding a new WFE and want to know if the solution has been deployed to that new WFE, or are you upgrading an existing solution that's already deployed? Update-SPSolution will not "re-deploy" per say. It will update components of that solution that have changed, but unless you're handling changes to the solution with code using feature version, new items will not be deployed as part of an Update-SPSolution call.

For example, if you add a new module with new masterpages and package, then run Update-SPSolution, your new module won't be processed. Those initial deployment tasks don't fire as part of an update. You would need code to handle the difference in version between what's on the server and the version you're now deploying, and instruct that code that if the version is n.n.n.n to process that module since it wouldn't have been there. There's a great webcast by Jeremy Thake on that side of feature development.

If you're just looking for solution status, there's a couple good blog posts out there that have methods for grabbing the last operation status of a solution with PowerShell... those are probably a good starting point (this one for example).

Tags:

Powershell