I have a powerCLI script that does the following:
Imports a csv (vmlist.csv) that looks like this:
VMname | Datacenter | Owner |
---|---|---|
vm1 | paris | john |
vm2 | london | jim |
vm3 | new york | joe |
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?