宇恒一号官网
This commit is contained in:
11
scripts/kill-ports.ps1
Normal file
11
scripts/kill-ports.ps1
Normal file
@@ -0,0 +1,11 @@
|
||||
# Kill processes on ports 8080/3000/3001
|
||||
$ports = @(8080, 3000, 3001)
|
||||
foreach ($p in $ports) {
|
||||
$conn = Get-NetTCPConnection -LocalPort $p -ErrorAction SilentlyContinue
|
||||
if ($conn) {
|
||||
$conn | ForEach-Object {
|
||||
Stop-Process -Id $_.OwningProcess -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
Write-Host "Port $p released"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user