enet-validator/scripts/session/webui_probe.ps1

12 lines
533 B
PowerShell
Raw Permalink Normal View History

[Console]::OutputEncoding = [Text.Encoding]::UTF8
foreach ($u in @("setup.htm","config.htm","reboot.htm","reset.htm","status.htm")) {
try {
$r = Invoke-WebRequest -Uri "http://192.168.123.1/$u" -TimeoutSec 4 -UseBasicParsing
Write-Host ("== " + $u + " (" + $r.StatusCode + ") ==")
[regex]::Matches($r.Content, '<(form|input|select|a)[^>]*>') | ForEach-Object { $_.Value } | Select-Object -First 20
Write-Host ""
} catch {
Write-Host ("== " + $u + " : " + $_.Exception.Message)
}
}