param( [Parameter(Mandatory=$true)] [string]$VmIp, [int]$DashboardPort = 8787, [int]$AuthPort = 3724, [int]$WorldPort = 8085 ) $ErrorActionPreference = "Continue" function Test-Port([string]$HostName,[int]$Port,[string]$Label) { $result = Test-NetConnection -ComputerName $HostName -Port $Port -WarningAction SilentlyContinue if ($result.TcpTestSucceeded) { Write-Host "[OK] $Label ${HostName}:$Port" -ForegroundColor Green return $true } Write-Host "[FAIL] $Label ${HostName}:$Port" -ForegroundColor Red return $false } Write-Host "AzerothAI PC Lab connectivity check" -ForegroundColor Cyan Write-Host "VM: $VmIp" Write-Host "" $ok = $true $ok = (Test-Port $VmIp $DashboardPort "World Monitor") -and $ok $ok = (Test-Port $VmIp $AuthPort "WoW authserver") -and $ok $ok = (Test-Port $VmIp $WorldPort "WoW worldserver") -and $ok try { $health = Invoke-RestMethod -Uri "http://${VmIp}:$DashboardPort/api/health" -TimeoutSec 5 Write-Host "[OK] AzerothAI health API" -ForegroundColor Green $health | ConvertTo-Json -Depth 5 } catch { Write-Host "[FAIL] AzerothAI health API" -ForegroundColor Red $ok = $false } if (-not $ok) { Write-Host "" Write-Host "One or more checks failed. Verify the VM is using Bridged networking and the Ubuntu firewall is not blocking these ports." -ForegroundColor Yellow exit 1 } Write-Host "" Write-Host "All network checks passed." -ForegroundColor Green Write-Host "World Monitor: http://${VmIp}:$DashboardPort" Write-Host "WoW realmlist: set realmlist $VmIp"