diff --git a/script/freePort.ps1 b/script/freePort.ps1 new file mode 100644 index 00000000..c29704aa --- /dev/null +++ b/script/freePort.ps1 @@ -0,0 +1,13 @@ +$defaultPort = 7456 + +$userPort = Read-Host "enter port [$defaultPort]:" + +if ($userPort -eq "") +{ + $userPort = $defaultPort +} + +Write-Host "free port: $userPort" + + +Get-NetTCPConnection -State Listen | Where-Object { $_.LocalPort -eq $userPort } | ForEach-Object { Get-Process -ID $_.OwningProcess } | Stop-Process \ No newline at end of file