Hi Guys,
I’m trying to create graphs with powershell, but i hit a snap with the input data.
I have a table in the form of:
Name,Date,Aggregate,TotalSize,AvailableSize,UsedSize
to make a graph i need the input to look as this:
Name,Date,Aggregate(Totalsize),TotalSize,AvailableSize,UsedSize
the code i am trying to adapt is this
(import-csv $LogDir\graph.csv) | Select @{Name=“Name”;Expression={$.name}}, @{Name=“Date”;Expression={$.date}},@{Name=“Aggregate”;Expression={{$.aggregate}{$.totalsize}}},@{Name=“TotalSize”;Expression={$.totalsize}},@{Name=“AvailableSize”;Expression={$.Availablesize}},@{Name=“UsedSize”;Expression={$_.usedsize}}|write-host
I know this is not working because my aggregates column is empty
@{Name=“Aggregate”;Expression={{$.aggregate}{$.totalsize}}}
if i remove the {$_.Totalsize} i will get the aggregate name but that’s not what i want
what do i need to do to get the output as:
aggregate(totalsize)
I hope one of you guru’s know the answer. if there would be another solution please feel free to add it…