Jump to content
Software FX Community

powergadgets or powershell problem?

Recommended Posts


I have a master script which passes a param to a drilldown script.

The drilldown script looks like:

$sCode = $args[0]
Invoke-Webservice -wsdl http://myserver/LiveMonitoring/MyMonitor.asmx?wsdl -method GetDataSet | where {$_.ShortCode -eq $sCode} | out-chart  -Label ShortCode -values Total -refresh 0:0:5 -topmost  -DataGrid_Visible true -Gallery gantt

First time it displays data but after 5 seconds it doesnt refresh and the problem is where cmdlet can not execute because the $sCode param is null.
Is this an out-chart issue? How can I get around it?


Link to comment
Share on other sites

I created another WS method that gets the parameter and it seems to work fine.

The script looks like this:
Invoke-Webservice -wsdl http://myserver/LiveMonitoring/MyMonitor.asmx?wsdl -method GetSingleRecordDataSet -parameters $sCode| out-chart  -Label ShortCode -values  Total -refresh 0:0:5 -topmost  -DataGrid_Visible true -Gallery gantt

 Another question though:
The refresh generates new "Total" bars on the chart due to single line dataset. How can I have the Total bar refresh itself without creating aditional bars.


Link to comment
Share on other sites

In the current public build when you only pass one element, a powergadgets chart will automatically "add" points every time the gadget is refreshed. Honestly we did not gave this a high priority because a chart with 1 bar might be better served by a gauge.

We have just added a flag where you can use the DisableAuto to turn off this behavior, e.g.

get-date -uformat "%S" | out-chart -refresh 0:0:1 -DisableAuto AddData

This will result in a chart with one bar (showing the current number of seconds) but the chart will refresh the bar value instead of adding bars. This flag will be supported in build 2769.


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.

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...