> How to i pass the results to the chart.pgt ? Is there such thing as $a |
> out-chart -template chart.pgt <company> <column 1> <column2>, as i wish to
> pass results *on the fly* ?
You might have options in that some of the parameters might accept
scriptblocks. If the parameters accept scriptblocks, you're a bit
farther ahead, but that won't do you much good if you're just passing
simple strings to out-chart.

You're going to need to pass objects to out-chart, then determine if
particular parameters can use scriptblocks for values.

You'd be better off doing something like this:

v2 CTP>$a
Company A 10 20
Company B 11 22
v2 CTP>$a|select-object @{expression={"Company "+$_.split('
')[1]};name="Company"},@{expression={$_.split(' ')[2]};na
me="Value1"},@{expression={$_.split(' ')[3]};name="Value2"}|format-table
-autosize

Company Value1 Value2
------- ------ ------
Company A 10 20
Company B 11 22

(Now, I didn't have time to try to format the above better. Note that
it should all be on one line, and that all of the splits are just done
on a space.)

*Then*, with the last command above, for example, you can pipe specific
objects to out-chart.



v2 CTP>$a|select-object @{expression={"Company "+$_.split('
')[1]};name="Company"},@{expression={$_.split(' ')[2]};na
me="Value1"},@{expression={$_.split(' ')[3]};name="Value2"}|where-object
{$_.Company -match "Company A"}|format-table -autosize

Company Value1 Value2
------- ------ ------
Company A 10 20




--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com