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

Input csv File to PowerCLI Script and Retain all Data

$
0
0

I have a powerCLI script that does the following:

 

Imports a csv (vmlist.csv) that looks like this:

 

VMnameDatacenterOwner
vm1parisjohn
vm2londonjim
vm3new yorkjoe

 

 

then I import the csv and add the CPU count as an additional row.  The problem is that multiple providers of input files provide info with different additional column names that all need to be preserved in the final output file.  The additional columns could be different based on the source and there could be any number of new columns with new data  in them in each new input file, all which need to be preserved in the output file.

 

How can I create a report that both adds a "NumCPU" column to the csv, and PRESERVES any other columns that are in the input file, and creates a new .csv with all the original data plus the numcpu count?


Viewing all articles
Browse latest Browse all 182126

Trending Articles



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