落地并存测服全端:智能体 Graph/路由、后台切 8180、主账与部署脚本齐备,便于线上重发与验收。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Force remove stale agent releases (not current)
|
||||
$ErrorActionPreference = 'Continue'
|
||||
$keepName = 'agent-20260913-210940'
|
||||
Get-ChildItem 'E:\wwwroot\agent\releases' | Where-Object { $_.PSIsContainer } | ForEach-Object {
|
||||
$name = $_.Name
|
||||
$full = $_.FullName
|
||||
if ($name -eq $keepName) {
|
||||
Write-Output ('KEEP ' + $name)
|
||||
return
|
||||
}
|
||||
Write-Output ('CLEAN ' + $name)
|
||||
Get-CimInstance Win32_Process | ForEach-Object {
|
||||
$cl = $_.CommandLine
|
||||
if ($cl -and $cl.Contains($full)) {
|
||||
Write-Output ('kill pid=' + $_.ProcessId)
|
||||
Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
Start-Sleep -Seconds 1
|
||||
cmd /c ("rmdir /s /q `"$full`"") | Out-Null
|
||||
if (Test-Path $full) {
|
||||
try {
|
||||
Remove-Item $full -Recurse -Force -ErrorAction Stop
|
||||
Write-Output ('REMOVED_PS ' + $name)
|
||||
} catch {
|
||||
Write-Output ('FAIL ' + $name + ' ' + $_.Exception.Message)
|
||||
}
|
||||
} else {
|
||||
Write-Output ('REMOVED ' + $name)
|
||||
}
|
||||
}
|
||||
Write-Output '=== left ==='
|
||||
Get-ChildItem 'E:\wwwroot\agent\releases' | ForEach-Object { $_.Name }
|
||||
Write-Output 'FORCE_CLEAN_OK'
|
||||
Reference in New Issue
Block a user