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_Date | Total_Size | VM_Count |
6/25/2013 | 10 | 1487 |
6/25/2013 | 10 | 1487 |
This CSV can not be imported
"Collection_Date","Total_Size","VM_Count"
"6/25/2013","10","1487"
Collection_Date | Total_Size | VM_Count |
6/25/2013 | 10 | 1487 |