Powershell – How to detect bad state VMs in a Hyper-V cluster?

[notranslate]
integration components are a good indicator of the health of a VM as it can tell us OS and services are properly started. it does not replace OS/application but can give you a quick clue about the health state of your VMs. Here I used the heartbeat IC to verify VM state from a Hyper-V perspective further we created a daily report which is sent to our team with a summary for each cluster like. as the report is been generated based on HTML we can also add some formatting to highlight failed VMs a.e. in red