powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $install='C:\ProgramData\CyberZarya\WiFiPrintAgent'; $script=Join-Path $install 'CyberZarya.PrintAgent.ps1'; if(-not (Test-Path -LiteralPath $script)){throw 'Файл установленного агента не найден'}; $taskName='CyberZarya WiFi Print Agent'; Stop-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue; $action=New-ScheduledTaskAction -Execute 'powershell.exe' -Argument ('-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File \"' + $script + '\"'); $trigger=New-ScheduledTaskTrigger -AtStartup; $settings=New-ScheduledTaskSettingsSet -RestartCount 5 -RestartInterval (New-TimeSpan -Minutes 1) -ExecutionTimeLimit ([TimeSpan]::Zero) -AllowStartIfOnBatteries -StartWhenAvailable; Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -Settings $settings -User 'SYSTEM' -RunLevel Highest -Force | Out-Null; Start-ScheduledTask -TaskName $taskName; Start-Sleep -Seconds 5; & (Join-Path $install 'Check-PrintAgent.ps1')"