I am trying to create chart by Get-CorpChart-FullEdition script, which I found very good in chart creation.
On the website I found below instruction.
-data
expects an array of objects, not a hashtable.
If you wanted to use a hashtable I think you can if you call the .GetEnumarator()
method
which effectively sends each entry in the hash table across the pipeline as a separate object.
. "D:\Auto\Get-Corpchart-LightEdition.ps1" -data $active_inactive.GetEnumerator() -obj_key "Name" -obj_value "Value" -filepath "c:\chart1.png" -type pie
Looking at the code for the light edition of the script the parameter is expecting an [array]
and not a hashtable.
You would be better of creating your own custom objects from that hashtable's data depending on how complex your date would get.
[pscustomobject]@{
State="Active"
Value=15
},[pscustomobject]@{
State="Inactive"
Value=25
}
Tonnes of ways to do this more effectively so the above is just an example.