Come to think about it, since you are already knee-deep into PowerCLI, your best option going-forward would be to handle the alarms thru your script thus you will be able to customise everything about the email. Setup the vCenter GUI alarm to trigger on xxxx, do not send email, do not send SNMP trap, Run Script xyz.
Your script can then query the environmental variables:
- VMWARE_ALARM_NAME
- VMWARE_ALARM_TARGET_NAME
- VMWARE_ALARM_EVENTDESCRIPTION
- VMWARE_ALARM_ALARMVALUE
To get everything you need.
PS C:\Users\jmilano> $Target_Name = 'MyVM'
PS C:\Users\jmilano> $TheVM = Get-VM -Name $Target_Name
PS C:\Users\jmilano> $TheHost = $TheVM.VMHost
PS C:\Users\jmilano> $Target_Name, $TheHost
MyVM
MyHost.mydomain
PS C:\Users\jmilano>
Your script then sends a customised email with all the required values.
Reference: https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.monitoring.doc/GUID-AB74502C-5F01-478D-AF66-672AB5B8065C.html