kmihalic Posted November 29, 2006 Report Posted November 29, 2006 Hi, I have tied to create function which will return single number and pipe output to gauge (digital). For example: function rr { $rdm = new-object random $rdm.next(100) } if I call function it will return random number, but when I tried $rr | out-gauge -type digital -refresh 0:0:1refresh would not work, only one number is displayed.Is this supported? Krunoslav
marco.shaw Posted November 29, 2006 Report Posted November 29, 2006 Maybe let the support people know what build you have? http://community.softwarefx.com/forums/t/9212.aspx
JuanC Posted November 29, 2006 Report Posted November 29, 2006 Refreshing is a very interesting feature in PowerGadgets. Hopefully we will make some time to blog about this in the not so distant future. The problem is that in order to support refresh we have to obviously reexecute the command that generated the data, the first tricky scenario is variables. We do support the following (if you are running a very old build it may not work) $a = "W*"ps $a | out-chart -refresh 0:0:5 Now run wordpad and check that the chart is refreshed with wordpad's process info. There are some subtleties on what type of variables we support but in the simple case it will just work. In your case - using functions - we are not able to push that function definition across so your gauge will not be refreshed. The only easy solution at this point is to move the body of the rr function to a PS1 file (e.g MyRandom.ps1) and then execute .\MyRandom.ps1 | out-gauge. In this case when we reexecute we ask powershell to reexecute MyRandom.ps1 and it should work as expected. Hope this helps JuanC
Recommended Posts
Archived
This topic is now archived and is closed to further replies.