From 75b8c83ea32d82465374830696dc314f732d1cfa Mon Sep 17 00:00:00 2001 From: luckyyzh Date: Mon, 3 Aug 2026 18:56:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1=20A?= =?UTF-8?q?ction=20=E5=8F=82=E6=95=B0=E6=94=B9=E5=8D=95=E5=BC=95=E5=8F=B7?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5=EF=BC=88`\"=20=E9=9D=9E=20PowerShell=20?= =?UTF-8?q?=E8=BD=AC=E4=B9=89=E5=BC=95=E5=8F=B7=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=96=B0=E7=94=B5=E8=84=91=E6=B3=A8=E5=86=8C=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=B6=E8=B7=AF=E5=BE=84=E8=A2=AB=E5=BD=93=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/local-tools/pi-agent-public.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/local-tools/pi-agent-public.ps1 b/data/local-tools/pi-agent-public.ps1 index ec9a5f8..c9831bf 100644 --- a/data/local-tools/pi-agent-public.ps1 +++ b/data/local-tools/pi-agent-public.ps1 @@ -40,9 +40,9 @@ function Ensure-Tasks { if (-not (Get-ScheduledTask -TaskName $webTaskName -ErrorAction SilentlyContinue)) { Write-Host " 注册计划任务 $webTaskName ..." $supervisorPath = Join-Path $PSScriptRoot 'pi-agent-web-supervisor.ps1' - $action = New-ScheduledTaskAction -Execute 'powershell.exe' ` - -Argument "-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -File `\"$supervisorPath`\"" ` - -WorkingDirectory $projectRoot + # 单引号拼接避免转义歧义(`\" 不是 PowerShell 转义引号) + $argument = '-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -File "' + $supervisorPath + '"' + $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument $argument -WorkingDirectory $projectRoot $trigger = New-ScheduledTaskTrigger -AtLogOn $settings = New-ScheduledTaskSettingsSet -StartWhenAvailable ` -RestartCount 999 -RestartInterval (New-TimeSpan -Minutes 1) `