Skip to content

Kills java instances for Azure pipelines #8568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions eng/scripts/KillProcesses.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ function _kill($processName) {
}
}

function _killJavaInstances() {
$_javaProcesses = Get-Process java -ErrorAction SilentlyContinue |
Where-Object { $_.Path -like "$env:JAVA_HOME*" };
foreach($_javaProcess in $_javaProcesses) {
try {
Stop-Process $proc
} catch {
Write-Host "Failed to kill java process: $proc"
}
}
}

_kill dotnet.exe
_kill testhost.exe
_kill iisexpress.exe
Expand All @@ -22,6 +34,8 @@ _kill vctip.exe
_kill chrome.exe
_kill h2spec.exe
_kill WerFault.exe
_killJavaInstances

if (Get-Command iisreset -ErrorAction ignore) {
iisreset /restart
}
Expand Down