1 2 3 4 5 6 7 8 9 10 11 12 |
$user="admin" $pass="admin123" $pair="${user}:${pass}" $bytes=[System.Text.Encoding]::ASCII.GetBytes($pair) $base64=[System.Convert]::ToBase64String($bytes) $basicAuthValue="Basic $base64" $headers=@{Authorization=$basicAuthValue} $url='http://192.168.1.1:89/rpDHCP.html' $result=(Invoke-WebRequest -Uri $url -Headers $headers) ($result.AllElements | Where tagName -eq "title").outerText $result.AllElements | Where tagName -eq "td" | %{if($_.innerText -match '192.168' -and $_.innerText -match '-'){$_.innerText}} |