Command: powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop';$root='C:\Users\ash\Documents\Codex\2026-08-26\LaptopBridge-DEV';$cfg=Get-Content -Raw -LiteralPath (Join-Path $root 'config.json')|ConvertFrom-Json;if([int]$cfg.port -ne 8766){throw 'DEV_CONFIG_PORT_GUARD_FAILED'};$conns=@(Get-NetTCPConnection -LocalPort 8766 -State Listen -ErrorAction SilentlyContinue);$pids=@($conns|Select-Object -ExpandProperty OwningProcess -Unique);$checked=@();foreach($pid8766 in $pids){$proc=Get-CimInstance Win32_Process -Filter ('ProcessId='+$pid8766);$cmd=[string]$proc.CommandLine;$checked += [pscustomobject]@{pid=$pid8766;cmd=$cmd};if($cmd -notlike '*dev_bridge_launcher.py*'){throw ('PORT8766_OWNER_GUARD_FAILED_'+$pid8766)}};foreach($pid8766 in $pids){Stop-Process -Id $pid8766 -Force -ErrorAction Stop};if($pids.Count -gt 0){Start-Sleep -Seconds 1};& (Join-Path $root 'start-dev-bridge.ps1');Start-Sleep -Seconds 4;$r=Invoke-WebRequest -UseBasicParsing 'http://127.0.0.1:8766/health' -TimeoutSec 5;$prod=Invoke-WebRequest -UseBasicParsing 'http://127.0.0.1:8765/health' -TimeoutSec 5;$new=@(Get-NetTCPConnection -LocalPort 8766 -State Listen -ErrorAction Stop|Select-Object -ExpandProperty OwningProcess -Unique);[pscustomobject]@{ok=($r.Content.Trim() -eq 'OK' -and $prod.Content.Trim() -eq 'OK');dev_health=$r.Content.Trim();prod_health=$prod.Content.Trim();old_pids=$pids;new_pids=$new;dev_port=8766;prod_port=8765;checked=$checked.Count}|ConvertTo-Json -Compress"
Directory: projects
Status: FAILED
Exit code: 1
Cancel Job Rerun Command Refresh
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
---DEV_BRIDGE_ALREADY_RUNNING
Invoke-WebRequest : Unable to connect to the remote server
At line:1 char:886
+ ... econds 4;$r=Invoke-WebRequest -UseBasicParsing 'http://127.0.0.1:8766 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand