Commit all scripts
This commit is contained in:
17
colaflow-api/find-port-process.ps1
Normal file
17
colaflow-api/find-port-process.ps1
Normal file
@@ -0,0 +1,17 @@
|
||||
# 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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user