I'm working on a report (to be published via HTML) that will show the MemReservationMB of all Resource Pools (RP) in a cluster, then loop through any VMs within that RP and add up all of the RAM assigned to those VMs. Afterward, I want to know how much MemReservationMB is left to that RP, if any, for new VMs or expansion of current ones.
So far, I have both halves, which show the RP stat and the sum of all VMs. What I cannot figure out is how to do the basic subtraction step afterward. It appears that PowerShell can handle operations with raw numbers, but not with variables.
Has anyone else run into this?
Thanks in advance...
Bonus points:
Ultimately, I'd like to also sum up all disk usage by VM in each RP, so if anyone wants to tee that one up...