diff --git a/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 b/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 index d0716146d8d3..74d27560af9d 100644 --- a/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 +++ b/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 @@ -772,6 +772,11 @@ function InvokeDTAExecHostExe([string] $Version, [System.Management.Automation.P Try { $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" } + Write-Verbose -Message ("Error : {0} " -f ($err | out-string)) -Verbose + Write-Verbose -Message ("Output : {0} " -f ($out | out-string)) -Verbose + Invoke-Command -Session $session -ErrorAction SilentlyContinue -ErrorVariable err -OutVariable out -scriptBlock { schtasks.exe /create /TN:DTAConfig /TR:$args /F /RL:HIGHEST /SC:MONTHLY ; schtasks.exe /run /TN:DTAConfig ; Sleep 10 ; schtasks.exe /change /disable /TN:DTAConfig } -ArgumentList $exePath Write-Verbose -Message ("Error : {0} " -f ($err | out-string)) -Verbose Write-Verbose -Message ("Output : {0} " -f ($out | out-string)) -Verbose diff --git a/Tasks/DeployVisualStudioTestAgent/task.json b/Tasks/DeployVisualStudioTestAgent/task.json index 3356a6b5c4a7..745af8ec940d 100644 --- a/Tasks/DeployVisualStudioTestAgent/task.json +++ b/Tasks/DeployVisualStudioTestAgent/task.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 32 + "Patch": 33 }, "demands": [ diff --git a/Tasks/DeployVisualStudioTestAgent/task.loc.json b/Tasks/DeployVisualStudioTestAgent/task.loc.json index 545d667eb01c..4e2bcf7c35e9 100644 --- a/Tasks/DeployVisualStudioTestAgent/task.loc.json +++ b/Tasks/DeployVisualStudioTestAgent/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 32 + "Patch": 33 }, "demands": [], "minimumAgentVersion": "1.101.0",