Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

Exporting Group-Objects by entities to CSV

$
0
0

Hi All,

 

I know that my query really to PS related in general, but since what I am trying to do is centred on the vSphere 4.1 environment someone might have done it before.

 

I love LucD's script to gain metrics of my VMs in terms of disk, cpu and memory, like http://communities.vmware.com/message/2039937, http://www.lucd.info/2011/07/08/powercli-vsphere-statistics-part-5-rollup-types/ and http://www.lucd.info/2010/01/05/powercli-vsphere-statistics-part-2-come-together/. I am wanting to be able to export the information to a CSV for each VM, and have tried two different methods for getting this to work.

 

I tried changing the location in the script where the export occurs, and putting the variable for the name in the export file name, but even though the redefined variable is correct (I checked it via a write-host immediately prior to the export-csv) it doesn't pick up the name and continually overwrites the file with the next machines data.

 

I tried to change the script using a ForEach loop operating for each machine in the array defined by entities, and running the report against each entity and then using a select statement to get the information I need. Again I tried using the name defined by $_.Group[0].Entity.Name in the select, in the export-csv command. Again it seems to ignore the definition for the VM name and overwrites the data within the same file.

 

Has anyone tried what I am attempting to know if it is possible?

 

Geoff


Viewing all articles
Browse latest Browse all 179681

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>