Powershell construct for mulitple values. Using the Invoke-WebRequest cmdlet.
hello, find $_.innerthtml -like "*brother* or "*hp*", when add "-or" operator, return value blank.
what better way write below snippet can lookup 2 or more values if exist where-object filter?
#####################################################
$site = read-host "enter printer ip"$request = invoke-webrequest -uri $site
$request.allelements| where-object {$_.innerhtml -like "*brother*"}|
sort-object { $_.innerhtml.length } | select-object innertext -first 1
thanks!
$request.allelements| where-object {$_.innerhtml -like '*brother*' -or $_.innerhtml -like '*hp*'}|
\_(ツ)_/
Windows Server > Windows PowerShell
Comments
Post a Comment