From 58310db80a6c4e3e97f456e1cde20fd09f660d0c Mon Sep 17 00:00:00 2001 From: Nitin Gurram Date: Wed, 6 Jul 2016 15:52:13 +0530 Subject: [PATCH] Restart the service instead of start to handle one corner scenario --- Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 | 4 ++-- Tasks/DeployVisualStudioTestAgent/task.json | 4 ++-- Tasks/DeployVisualStudioTestAgent/task.loc.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 b/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 index 74d27560af9d..7c1aed37f1e7 100644 --- a/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 +++ b/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 @@ -773,7 +773,7 @@ function InvokeDTAExecHostExe([string] $Version, [System.Management.Automation.P { $session = CreateNewSession -MachineCredential $MachineCredential # Make sure DTA Agent Execution Service starts first before invoking DTA Execution Host - Invoke-Command -Session $session -ErrorAction SilentlyContinue -ErrorVariable err -OutVariable out { Start-Service -Name "DTAAgentExecutionService" } + Invoke-Command -Session $session -ErrorAction SilentlyContinue -ErrorVariable err -OutVariable out { Restart-Service -Name "DTAAgentExecutionService" } Write-Verbose -Message ("Error : {0} " -f ($err | out-string)) -Verbose Write-Verbose -Message ("Output : {0} " -f ($out | out-string)) -Verbose @@ -955,4 +955,4 @@ if ($ret -eq $false) { $returnCode = ConfigureTestAgent -TfsCollection $tfsCollectionUrl -AsServiceOrProcess $asServiceOrProcess -EnvironmentUrl $environmentUrl -MachineName $machineName -MachineUserCredential $machineCredential -DisableScreenSaver $disableScreenSaver -EnableAutoLogon $enableAutoLogon -PersonalAccessToken $PersonalAccessToken -Capabilities $capabilities -AgentUserCredential $agentCredential return $returnCode; -} \ No newline at end of file +} diff --git a/Tasks/DeployVisualStudioTestAgent/task.json b/Tasks/DeployVisualStudioTestAgent/task.json index 745af8ec940d..c4d6f22e6c52 100644 --- a/Tasks/DeployVisualStudioTestAgent/task.json +++ b/Tasks/DeployVisualStudioTestAgent/task.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 33 + "Patch": 34 }, "demands": [ @@ -171,4 +171,4 @@ "workingDirectory": "$(currentDirectory)" } } -} \ No newline at end of file +} diff --git a/Tasks/DeployVisualStudioTestAgent/task.loc.json b/Tasks/DeployVisualStudioTestAgent/task.loc.json index 4e2bcf7c35e9..fa94bb244a6b 100644 --- a/Tasks/DeployVisualStudioTestAgent/task.loc.json +++ b/Tasks/DeployVisualStudioTestAgent/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 33 + "Patch": 34 }, "demands": [], "minimumAgentVersion": "1.101.0", @@ -169,4 +169,4 @@ "workingDirectory": "$(currentDirectory)" } } -} \ No newline at end of file +}