Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 192300

Failure to import CSV with ConvertFrom-Csv

$
0
0

I have a script that is designed to record the consumed data of all my virtual machines and create a CSV with the data.  The script checks for the existence of a file with the same name as the output  file and I attempt to set the file as an array so that I can add the next day's data.  I found that if the CSV only has one row of data the code   $csvreport=typeC:\Temp\DataGrowth.csv | ConvertFrom-Csv fails to import the file.  If I create a second row of data the code works perfectly.  Can anyone tell me why this is happening? 




This csv can be imported

 

"Collection_Date","Total_Size","VM_Count"

"6/25/2013","10","1487"

"6/25/2013","10","1487"

"6/25/2013","10","1487"

 

 

Collection_DateTotal_SizeVM_Count
6/25/2013101487
6/25/2013101487

 

 

This CSV can not be imported

 

"Collection_Date","Total_Size","VM_Count"

"6/25/2013","10","1487"

 

Collection_DateTotal_SizeVM_Count
6/25/2013101487

Viewing all articles
Browse latest Browse all 192300

Trending Articles



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