Files
eene_dashboard/scripts/kill-ports.ps1
EENE Dashboard b3f2da203b EENE Dashboard upload to Gitea
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 16:59:34 +09:00

12 lines
354 B
PowerShell

$ports = @(4000, 3000, 3001)
$killed = @()
Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue |
Where-Object { $ports -contains $_.LocalPort } |
ForEach-Object {
$procId = $_.OwningProcess
if ($killed -notcontains $procId) {
Stop-Process -Id $procId -Force -ErrorAction SilentlyContinue
$killed += $procId
}
}