blob: 0668a5319777945b3fbcca2e373e3f921b63ffb0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# Kill leftover CI test processes (zenserver, minio, nomad, consul) whose
# executable lives under the given build directory. Windows counterpart of
# kill-test-processes.sh; see that file for rationale.
#
# Usage: kill-test-processes.ps1 -Label <label> -BuildDir <path>
param(
[Parameter(Mandatory=$true)][string]$Label,
[Parameter(Mandatory=$true)][string]$BuildDir
)
foreach ($name in @('zenserver', 'minio', 'nomad', 'consul')) {
$procs = Get-Process -Name $name -ErrorAction SilentlyContinue |
Where-Object { $_.Path -and $_.Path.StartsWith($BuildDir, [System.StringComparison]::OrdinalIgnoreCase) }
foreach ($p in $procs) {
Write-Host "Killing $Label $name (PID $($p.Id)): $($p.Path)"
$p | Stop-Process -Force -ErrorAction SilentlyContinue
}
}
|