From 86f9dcf1cc06793c23f67e00916db8fda4a8e621 Mon Sep 17 00:00:00 2001 From: Riwut Libinuko Date: Wed, 5 Oct 2016 07:15:31 +0800 Subject: [PATCH] Uninstall solution individually Uninstall-SPSolution -AllWebApplication , may fail or timeout if farm solution is not deployed to all Web Application. The fix, replaces -AllWebApplication by iterating through DeployedWebApplication and uninstall it individually --- SPSD.Script/Scripts/SPSD_Deployment.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SPSD.Script/Scripts/SPSD_Deployment.ps1 b/SPSD.Script/Scripts/SPSD_Deployment.ps1 index a1d87c8..8567b8d 100644 --- a/SPSD.Script/Scripts/SPSD_Deployment.ps1 +++ b/SPSD.Script/Scripts/SPSD_Deployment.ps1 @@ -1838,8 +1838,6 @@ if ($solution.ContainsWebApplicationResource) { - - $caUrl = (Get-spwebapplication -includecentraladministration | where {$_.IsAdministrationWebApplication}).Url if(($solution.DeployedWebApplications | ? { $_.Url -eq $caUrl}) -ne $null){ # Solution also deployed to central admin @@ -1849,7 +1847,9 @@ WaitForJobToFinish $solutionName -Retract Log -Message "Retracting (all other web applications)..." -Type $SPSD.LogTypes.Normal -NoNewline } - Uninstall-SPSolution -Identity $solutionName -AllWebApplications -Confirm:$false + $solution.DeployedWebApplications |? { $_.Url -ne $caUrl } |% { + Uninstall-SPSolution -Identity "$solutionName" -WebApplication $_.Url -Confirm:$false + } } else {