Jump to content
Software FX Community

What is the format to pipe data to out-chart from within a script?


jg167

Recommended Posts

I would like to have a script that contains a procedure that is called each time out-chart -refresh needs new data.

Currently I hack this by having a script continuously produce a x.cxv file (just 2 lines label1,label2,...\nvalue1,value2... and then just do

import-csv x.csv |out-chart -repeat 0:0:0.2 -template .....

That works, but I'd much rather have a .ps1 script that does

$get_data

{

run around looking at whatever and produce the values to be graphed

}

&$get_data | out-chart -template foo -refresh 0:0:0.2 -...

But what format does get_data write (or echo or... I'm a linux guy and am new to the PowerShell or WIndows for that mattter) a set of values in to be what out-chart is expecting?

The same should be the case if get_data was itself a scirpt and one did (something like)

get_data.ps1 | out-char

Can you do that? (agian in bash no problem but this is PowerShell! so I don't know)

Link to comment
Share on other sites

To be a little more clear, what I want to do is pull some data form the last line of some files, and then pass that data, come computations on that data, the number of files, etc to out-chart. So I have to construct an object of the type out-chart is expecting. This seems like it would be common enough to have some stock scripts for powershell that would do so.

I think I'll be able to figure it out by looking at thinks like the output of stuff like import-csv ./perf.csv |get-member but it would be much easier if someone had it done already and I could just stick in the part that generates the data I want!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...