# 看门狗:崩溃自动重启(原生 DLL 偶发 0xC0000005 的兜底) # 用法:powershell -File supervisor.ps1 while ($true) { $exe = Join-Path $PSScriptRoot "..\publish\fpcollect-agent.exe" if (-not (Get-Process fpcollect-agent -ErrorAction SilentlyContinue)) { Start-Process -FilePath $exe -WorkingDirectory (Split-Path $exe) Write-Host "$(Get-Date -Format 'HH:mm:ss') 已启动 agent" } Start-Sleep 3 }