I have a script which outputs a list of hosts within a vCenter and details the cluster that each host is in, what I can't figure out is how to insert a blank line into the array whenever the "Cluster Name" of each host changes.
To say it a different way, I want to separate items in a list out by using blank lines, and I want to insert one of these blank lines every time the "Cluster Name" property of each item changes.
For example at the moment my output is something roughly like this:
Host Cluster
Host1 Cluster1
Host2 Cluster1
Host3 Cluster2
Host4 Cluster2
But I want it to appear like:
Host Cluster
Host1 Cluster1
Host2 Cluster1
Host3 Cluster2
Host4 Cluster2