stevevillardi / Logic.Monitor

LogicMonitor PowerShell Module for automating LM Portal tasks using APIv3
https://www.powershellgallery.com/packages/Logic.Monitor
Mozilla Public License 2.0
23 stars 3 forks source link

Multiple results returned when using Name parameter in Get/Set commands #2

Closed stevevillardi closed 3 years ago

stevevillardi commented 3 years ago

Currently when using Get/Set commands with the name parameter if multiple devices exist with the same name we need to handle that edge case better, we are currently just grabbing the first response but we should throw an exception and stop proceeding so we do not accidentally modify the incorrect resource as the Name(IP/DNS) field is not unique across the portal.

stevevillardi commented 3 years ago

Added helper function to check Named lookup for multiple return values. this will allow for wildcard named parameters and as long as a single result is returned continue processing. Currently implemented and a few of the newer modules, will need to revisit the Set/New/Remove commands to see which ones make sense to switch over to us the helper function.