I did go through those blog posts, but they just creates a HostGroup or VMGroup and creates a rule which maps Hosts to VMs.
What if I have those already and want to export them to a CSV or TXT file like your script did for VMAntiAffinity rules.
It would be a great idea to back them up too.
Please if you can let me know how I can go, or anything would be helpful!
Thanks LucD!