I’ve got a script that saves upload and download times of a file to our corporate filestore and records the time in milliseconds in a csv file. After a lot of mucking about, I’ve got a PowerShell line graph tile in SquaredUp to display the results, but it seems to only be showing the last value, not all values in the csv.
Here’s the script for the tile:
#SquaredUp tile
$data = Import-Csv -LiteralPath \\prs-data\scom\filemon\report.csv -Delimiter ',' -Header 'DateTime','Uploadtime','Downloadtime'
$data | Select @{
Name = "DateTime";
Expression = {[datetime]::ParseExact($_.DateTime, 'dd-MM-yyyy HH:mm:ss', $null)}
},
@{
Name = "UploadTime";
Expression = {[int]::Parse($_.Uploadtime)}
},
@{
Name = "DownloadTime";
Expression = {[int]::Parse($_.Downloadtime)}
}
The response data is as expected:
DateTime UploadTime DownloadTime
21/07/2022 17:15:09 55 40
21/07/2022 17:15:11 60 35
21/07/2022 17:15:13 74 37
21/07/2022 17:15:14 53 35
21/07/2022 17:15:15 98 36
21/07/2022 17:43:25 144 38
21/07/2022 17:44:40 98 42
21/07/2022 17:52:49 761 39
21/07/2022 18:02:49 703 96
21/07/2022 18:12:49 445 39
21/07/2022 18:22:49 444 40
21/07/2022 18:32:49 323 38
But the graph looks like this:
What am I doing wrong, is it something with page timeframe?