$lines = netstat -ano | Select-String ":8000 "
foreach ($line in $lines) {
    $parts = $line.ToString().Trim() -split '\s+'
    $pid_val = $parts[-1]
    if ($pid_val -match '^\d+$') {
        Stop-Process -Id ([int]$pid_val) -Force -ErrorAction SilentlyContinue
        Write-Host "Killed PID $pid_val"
    }
}
Start-Sleep -Seconds 2
Write-Host "Port 8000 cleared"
