# Arrête les processus Java démarrés par quarkus:dev (libère target)
$procs = Get-CimInstance Win32_Process -Filter "name = 'java.exe'" |
    Where-Object { $_.CommandLine -and ($_.CommandLine -like '*unionflow*' -or $_.CommandLine -like '*quarkus*') }
foreach ($p in $procs) {
    Write-Host "Arret PID $($p.ProcessId): $($p.CommandLine.Substring(0, [Math]::Min(80, $p.CommandLine.Length)))..."
    Stop-Process -Id $p.ProcessId -Force -ErrorAction SilentlyContinue
}
if (-not $procs) { Write-Host "Aucun processus Java unionflow/quarkus en cours." }
Write-Host "Termine."
