This morning I noticed a conversation on twitter that pointed to the following communities post: https://communities.vmware.com/thread/533417
It reminded me that I had to do the same a while back. The requirement was to interrogate the hosts and send an email to the requester with cdp information in the body of the message and also as a html attachment.
I thought I’d share what I had just in case somebody else had the same question in the future. The code is pretty dusty so could do with a bit of tidying up but here are the two gists: