Can you tell what is difference between on 2 variable: $data and $res.
I have script what is reading csv file and generate graph from them.
$data is not working when I try to genarate graps but $res is working.
Error Message what I get when I use $data variable is
Exception calling "DataBindXY" with "2" argument(s): "Series data points do not support values of type System.Managemen
t.Automation.PSObject only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String,
DateTime, short, ushort."
At C:\UserData\Work\Powershell Scripts\Ping\Graph_Maker_Agrecate.ps1:225 char:2
+ $chart.Series["Delay"].Points.DataBindXY($Data.datetime, $Data. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
when I use $data or $res I get same kind variable info
Without having access to some sample data it’s going to be hard to tell you the cause. I would also note that $Data is considered for one-liners and $res is proper coding practice when building a script. I don’t know if I would waste to much time trying to figure out why the non-best practice method doesn’t work.
I suspect the overall object type may be causing an issue, example below of just importing a basic csv file in test1.