![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Re: powergadget : how to pass parameters Quote: > 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* ? 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 |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can I pass parameters when opening Word | VB Script | |||
| Pass parameters to XBAP from webpage | .NET General | |||
| Powergadget version | PowerShell | |||
| printer no paper - how to pass to powergadget | PowerShell | |||
| Powergadget - Out-Line | PowerShell | |||