christianv Posted June 6, 2007 Report Share Posted June 6, 2007 Hi I need help getting data to an innergauge, It only seems to hold fixed values, og the same value as the main gauge. thanks :-) Quote Link to comment Share on other sites More sharing options...
JuanC Posted June 7, 2007 Report Share Posted June 7, 2007 You will have to write a powershell script that returns an object with 2 (or more) properties, the value you want in the main gauge and the one for the inner gauge. You can find a sample of this technique here Your script will be similar to RandomData.ps1 and you will invoke it in a very similar way to the second-to-last sample in that blog post. e.g. .\randomdata.ps1 | out-gauge -value Sales -InnerGauges_Add Digital -InnerGauges_0_Layout_Target AnchorPoint -InnerGauges_0_Layout_AnchorPoint 0,-0.5 -InnerGauges_0_DigitalPanel_Value {$_.PrevSales} Note that setting the LayoutTarget and the AnchorPoint properties is used to position the inner gauge. Unfortunately it is not possible to achieve this (bind the inner gauge value or for that fact any other property but the main value) using PowerGadgets Creator but there is a trick you can use. Once you have your script returning the data you want and the gauge reading that data from powershell, you can press Ctrl-C when the gadget is the active window and then press Ctrl-V inside Creator. You will not be able to change the "binding" for the innergauge value property but you will be able to customize everything else using creator instead of typing the commands in the console window. Hope this helps. JuanC Quote Link to comment Share on other sites More sharing options...
christianv Posted June 7, 2007 Author Report Share Posted June 7, 2007 Thanks Juan, But I am having issues using the (trial version) PowerGadgets with PS as i keep getting: The term 'out-chart' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. I have reinstalled PS, and PowerGadgets - but still get this am I missing some part of the installation? Kind regards, Christian Quote Link to comment Share on other sites More sharing options...
christianv Posted June 7, 2007 Author Report Share Posted June 7, 2007 Actually I just found out what to do: I ran the following in the PowerShell Window: add-pssnapin PowerGadgets This did the trick. Thanks chrisitan Quote Link to comment Share on other sites More sharing options...
JuanC Posted June 7, 2007 Report Share Posted June 7, 2007 To avoid doing this on each of your powershell sessions you can 1) Execute a shortcut we create in the Start Menu PowerGadgets. This points to a PSC1 file that will add the powergadgets snapin to the session. 2) Temporarily add this line to your profile.ps1 (<Documents>\WindowsPowerShell folder). This will apply to all sessions including if you run the PowerShell created shortcut. JuanC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.