Files
ColaFlow/colaflow-api/find-port-process.ps1
Yaojia Wang 4183b10b39
Some checks failed
Code Coverage / Generate Coverage Report (push) Has been cancelled
Tests / Run Tests (9.0.x) (push) Has been cancelled
Tests / Docker Build Test (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Commit all scripts
2025-11-03 17:19:20 +01:00

18 lines
588 B
PowerShell

# Find process using port 5167
$port = 5167
$connections = netstat -ano | Select-String ":$port "
Write-Host "Connections on port $port :" -ForegroundColor Yellow
$connections | ForEach-Object {
Write-Host $_ -ForegroundColor Gray
if ($_ -match '\s+(\d+)\s*$') {
$pid = $matches[1]
try {
$process = Get-Process -Id $pid -ErrorAction Stop
Write-Host " PID: $pid - Process: $($process.ProcessName)" -ForegroundColor Cyan
} catch {
Write-Host " PID: $pid - Process not found" -ForegroundColor DarkGray
}
}
}