I use the following command to pull values ββfrom html input fields in a web management interface on a simple linux print device.
$get = Invoke-WebRequest -Uri ("http://" + $station + ":8080/cgi-bin/admin?page=pedi.sh&hash=" + $hash) -Method "GET
One of the input fields is a checkbox, I need to check if this is checked or not. In this case, the flag is called "Protocol" and it is checked.
$get.ParsedHtml.getElementsByName("Protocol") | Select checked
checked
True
If I try to get the value with the following command, it returns nothing.
($get.ParsedHtml.getElementsByName("Protocol")).checked
But if I do this, I get the value ...
($get.ParsedHtml.getElementsByName("Protocol") | Select checked).checked
I wonder why I see this behavior, is this normal?
I am running Windows 8 RTM, PowerShell 3.0. If you need more information, please let me know.
source share