lwsrbrts / PoSHue

Windows PowerShell 5/PowerShell Core 6 Classes for controlling Philips Hue Bridge and Hue Lights, Groups, Sensors.
GNU Lesser General Public License v3.0
51 stars 7 forks source link

FindHueBridge not working right #21

Closed TobiasPSP closed 2 years ago

TobiasPSP commented 3 years ago

First, thanks a ton for your great work! I am currently digging my way into it and came across a serious flaw that should be really easy to fix.

For example, this fails:

[HueBridge]::FindHueBridge() | Out-GridView

Here is the flaw (inside FindHueBridge()):

$UPnPDevices = $UPnPFinder.FindByType("upnp:rootdevice", 0) | 
Where-Object {$_.Description -match "Hue"} | 
Select-Object FriendlyName, PresentationURL, SerialNumber | 
Format-List

By adding Format-List at the end of your pipeline, you are effectively turning the valuable real objects into useless formatting objects that now can only be displayed in the console.

I'd love you to simply remove the Format-List statement at the end of above pipeline, thus enabling users to actually make use of the results of FindHueBridge() in an object-oriented manner.

Thanks so much!