-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue in setting the registry for auto logon and resolving the do…
…main name for local user accounts
- Loading branch information
🔥Nitin Gurram🔥
committed
Mar 9, 2017
1 parent
7f120e3
commit cce533c
Showing
5 changed files
with
139 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 26 additions & 15 deletions
41
Tasks/DeployVisualStudioTestAgent/VerifyTestAgentInstalled.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
function CheckTestAgentIsRunning([string] $ProcessName) { | ||
$dtaProcess = Get-Process -Name $ProcessName -ErrorAction SilentlyContinue | ||
if (-not $dtaProcess) | ||
{ | ||
Write-Verbose "Test Agent is not running as it's not configured against Team Foundation Service" -verbose | ||
$dtaProcess = Get-Process -Name $ProcessName -ErrorAction SilentlyContinue | ||
|
||
if (-not $dtaProcess) | ||
{ | ||
Write-Verbose "DTAExecutionHost is not running" -Verbose | ||
return | ||
} | ||
Write-Verbose "Test Agent is already running" -verbose | ||
} | ||
|
||
Write-Verbose "Test Agent is already running" -Verbose | ||
Write-Verbose "Stopping the current DTAExecutionHost process" -Verbose | ||
Stop-Process $dtaProcess -ErrorAction SilentlyContinue | ||
} | ||
|
||
function RemoveTestAgentServiceIfExists([string] $ServiceName) { | ||
# Stop DTA Services if anything is running or registered | ||
# This is to make sure DTAv1 doesn't cause trouble during *reboots* for DTAv2 | ||
Remove-Service -ServiceName "DTAAgentExecutionService" | Out-Null | ||
} | ||
|
||
function CheckTestAgentInstalled([string] $ProductVersion = "14.0") { | ||
Write-Verbose "Query for Testplatfrom version: $ProductVersion" | ||
Write-Verbose "Query for Testplatfrom version: $ProductVersion" | ||
|
||
$versionInstalled = Get-TestAgentInstalledVersion -ProductVersion $ProductVersion # Get installed test agent version as per user requested version | ||
if($versionInstalled -ne "0.0") { | ||
Write-Verbose -Message ("Test Agent already exists") -verbose | ||
Write-Verbose -Message ("Version: $versionInstalled") -verbose | ||
$versionInstalled = Get-TestAgentInstalledVersion -ProductVersion $ProductVersion # Get installed test agent version as per user requested version | ||
if($versionInstalled -ne "0.0") { | ||
Write-Verbose -Message ("Test Agent already exists") -Verbose | ||
Write-Verbose -Message ("Version: $versionInstalled") -Verbose | ||
|
||
CheckTestAgentIsRunning -ProcessName "DTAExecutionHost" | ||
} else { | ||
Write-Verbose -Message ("Test Agent does not exists") -verbose | ||
} | ||
RemoveTestAgentServiceIfExists -ServiceName "DTAAgentExecutionService" | ||
CheckTestAgentIsRunning -ProcessName "DTAExecutionHost" | ||
} else { | ||
Write-Verbose -Message ("Test Agent does not exists") -Verbose | ||
} | ||
} | ||
|
||
CheckTestAgentInstalled -ProductVersion $ProductVersion |
Oops, something went wrong.