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

Get-LMEscalationChain destination export #11

Closed jessewolcott closed 1 year ago

jessewolcott commented 1 year ago

Hello, great module! I'm trying to extract destination addresses out of Get-LMEscalationChain, and I believe its returning a malformed object. I have 3 emails in my escalation chain, and its returning {@{type=single; period=; stages=System.Object[]}}, which I think is an extra set of braces!

I might be wrong

stevevillardi commented 1 year ago

Thanks for the report, let me take a look at the issue and see if I can reproduce it.

jessewolcott commented 1 year ago

Sure thing, let me know if I can help

stevevillardi commented 1 year ago

So I took a look at the output from one of my portals and the code seems to be correct, I think because of the way PowerShell displays nested array objects with multiple fields you end up just seeing the object type within the array instead of the entire output. If you were to actually try to retrieve the value you can access the data just fine.

image

Or if you convert it to JSON as well you can see the entire result set:

image

Let me know if that answers your issue, otherwise happy to discuss this further to better understand what you are looking for.

jessewolcott commented 1 year ago

Nope, that is perfect, turns out I didn't go deep enough. Thank you for the explanation, its working great!