Files
WC-SPC/MES-Manager_View/scripts/stop-ai.ps1
2026-05-27 14:39:35 +08:00

14 lines
373 B
PowerShell

$connections = Get-NetTCPConnection -LocalPort 3100 -State Listen -ErrorAction SilentlyContinue
if (-not $connections) {
Write-Output "AI MCP service is not running on port 3100."
exit 0
}
$connections | ForEach-Object {
$pidValue = $_.OwningProcess
if ($pidValue) {
Stop-Process -Id $pidValue -Force
Write-Output "Stopped AI MCP process $pidValue."
}
}