# win8-bridge launcher - keeps agent.ps1 running; restarts it 5 s after it exits (update or crash). # The scheduled task "win8-bridge" runs this at boot as SYSTEM with no time limit. $Dir = Join-Path $env:ProgramData 'win8-bridge' $PsExe = Join-Path $env:SystemRoot 'System32\WindowsPowerShell\v1.0\powershell.exe' $Agent = Join-Path $Dir 'agent.ps1' while ($true) { try { & $PsExe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File $Agent } catch { } Start-Sleep -Seconds 5 }