Initial import
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
$ports = 8081, 8082, 8083, 8084
|
||||
|
||||
foreach ($port in $ports) {
|
||||
$connections = Get-NetTCPConnection -State Listen -LocalPort $port -ErrorAction SilentlyContinue
|
||||
foreach ($connection in $connections) {
|
||||
$process = Get-Process -Id $connection.OwningProcess -ErrorAction SilentlyContinue
|
||||
if ($process -and $process.Path -eq 'C:\xampp\php\php.exe') {
|
||||
Stop-Process -Id $process.Id -Force
|
||||
Write-Host "Stopped PHP server on port $port"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user