# Open Windows Firewall for ShopDB VM Access # Run this as Administrator on the Host PC Write-Host "Adding Windows Firewall rule for ShopDB API..." -ForegroundColor Cyan try { New-NetFirewallRule ` -DisplayName "ShopDB API - Port 5001" ` -Direction Inbound ` -LocalPort 5001 ` -Protocol TCP ` -Action Allow ` -Profile Any ` -ErrorAction Stop Write-Host "SUCCESS: Firewall rule added!" -ForegroundColor Green Write-Host "" Write-Host "ShopDB is now accessible from VMs at:" -ForegroundColor Yellow Write-Host " https://172.31.96.1:5001" -ForegroundColor White Write-Host " https://172.30.0.1:5001" -ForegroundColor White Write-Host "" Write-Host "Test from VM with:" -ForegroundColor Yellow Write-Host " Test-NetConnection -ComputerName 172.31.96.1 -Port 5001" -ForegroundColor White Write-Host "" } catch { Write-Host "ERROR: Failed to add firewall rule" -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor Red Write-Host "" Write-Host "Make sure you're running PowerShell as Administrator!" -ForegroundColor Yellow exit 1 }