Jump to content
Software FX Community

marco.shaw

Members
  • Posts

    249
  • Joined

  • Last visited

Posts posted by marco.shaw

  1. - You should use either ToolTipFields ot ToolTipFormat but not both.

    - We have found a bug in some versions of PowerGadgets that make ToolTipFields parameter ignored, this issue has been fixed on build 2783 or later. We will make this build available shortly.

    - With a fixed version you should be able to just say -ToolTipFields Site and you will get the following tooltip

    Tickets:22

    Site: XYX

    Note that currently we do not support scriptblocks in ToolTipFields and that we will automatically start with the field being charted. Would this be enough for your scenario or is the order of the 2 lines important? If you want to see Facility instead of Sites you could modify your SQL statement to return the field as Facility.

    JuanC

    I have build 2806, and "-ToolTipFields Site" does not work properly, the tool tip shows me:

    ---------------- 

    tickets:11

    >10

    ----------------

    Which is not what we are asking it to do.

    Djake: When do you need this for?  I can provide a workaround...

  2. Hey Marco,

    I talked with tech support and they said 2783 build was in the newest (7/23) release.  I downloaded and tried it, but the functionlity was not changed.  Under the new -Tooltipsfields (as it is intended to work), can you give it more than one parameter name or is it limited to a single parameter?

    Best,

    David

    I'll have to try it out.  I believe you were sent a private link for paying customers.  A new build was (2806) was placed there just this last Tuesday.

    I'll have to check if I have 2783 locally.  I had problems with a particular build lately when I tried to upgrade, and that may be the version.  I might have to go with a test virtual machine to be able to try that build out.

    First, I'll have to try to figure out how I can reproduce what you're trying to do with just a few lines of code as dummy/fake input.

    It could take me a few days to find time to play with this.

    (Just to clarify: I am not a PowerGadgets employee, so this testing is done in my spare time.)

  3. Speed?  You want slower or faster?  For slower, just increase the -refresh value from 0:0:01 to something higher.  To make it faster...  Well, out-gauge -refresh doesn't seem to accept milliseconds.  Another way would be to make it scroll 2 characters at a time, but the appearance would be "jerky-ish"...

    I was wrong, -refresh does accept milliseconds: -refresh 0:0:0.1 (for 100 milliseconds).  That will make the scolling go much faster.  So a 1/2 second refresh would be "-refresh 0:0:0.5" (seems anything missing is automatically filled in).

  4. OK, maybe this is the problem...

    You have to call it like this, for example:

    PSH>./scrollv2.ps1|out-gauge -type digital -floating -refresh 0:0:01

    I have an idea on how I can get the $global variables to reset properly to zero (see note in the comments to my first version).

    I have to leave right now.  Using read-inputbox will be simple to implement...

  5. Marco,

    Yeah I took out the refresh because it kept prompting me for an input box for however many seconds or minutes I set it to. Also, I wanted to put a input box for our staff to run the gadget and enter text based on present events. I don't really need it to refresh because, i.e., whenever we have an outage, we want to put in text to scroll for staff to see it. We have a large LCD TV setup so staff can see what's going on at that time. Thanks for the help I haven't tried using your last script that you just posted but I just wanted to reply back to your first post. Thanks for the help.

    valdezdj

    Sorry, I'm not fully following you.  You mention not needing it to refresh, but you must have it refresh for the text to appear to scroll.  That's how I create the illusion.

    I'm also going to add my flash code with the scrolling code...  That might be useful in your scnenario where you just put up a new message: it will first scroll when something new is added, then start to scroll...  You'd have to kill/quit the gadgets, then restart the .ps1 script.  Is that acceptable, or you'd want something more automatic like that.  Being able to start a gadget, have it run *forever*, but have the text be variable all the time could have some issues.

    I hope I'm making myself clear...

    ZoomIssue.zip

  6. OK, here's "version 2".  Instead of using read-inputbox from Sapien, I just used read-host which is built-in with PowerShell.  You may want to modify "test.tmp" to a name/location more appropriate.  This is a temporary file only, that will be created, then deleted.

    -------scrollv2.ps1------------

    $global:value=7$spacer=" "*7

    if (test-path test.tmp) {  $global:string=get-content test.tmp;remove-item test.tmp} else {  if ($global:string -eq $null) {   read-host "Enter the text to scroll"|out-file -filepath test.tmp -encoding ascii   $global:string=get-content test.tmp  }}

    $scrollString=$spacer+$global:string+$spacer$scrollText=$scrollString.Substring($global:iteration,$global:value)

    if ($global:iteration -lt $scrollString.length-$global:value) {  $global:iteration++  } else {  $global:iteration=0 }

    $scrollText

    ------------

    Sorry, no code comments this time around...  Let me know if that does the trick for you.

    [Edit: Added a prompt to the read-host cmdlet.]

  7. Interesting use of my blog post.  I don't have time right now to provide you with a working/tested solution, but I see some fundamental issues with variables and how PowerGadgets with refresh works:

    1.  You didn't declare a -refresh parameter in your out-gauge call.2.  You cannot use out-gauge in this manner to use it to refresh.3.  When you do actually use -refresh, a couple of problems will happen:  a)  You are declaring a *local* or *script* variable when you simply declare "$string=read-inputbox...".  :D  When using -refresh, your first invokation of the .ps1 script runs in the current PowerShell runspace/console, but on the 2nd (and forever after) invokation of the script, it is actually run from another "detached" PowerShell runspace.  This new detached runspace starts from scratch and will try to run "$string=read-inputbox..." again by itself, but won't be able to send anything to you because it can't talk to the console.4. I also mention in the blog post about seeing strange things when the ticker is first called (having to reset global variables to zero manually).

    So, the important thing that I think will be required is that when the script is first called, it will have to write the string to a temporary file, and then the new PowerShell runspace will read the file, store its contents in a *global* variable, then delete the temporary file.

    Something for you to think about...  I'll provide you with something that works by Tuesday, if you need help.

    [Edit: Added point #4.]

    post-3268-13922403391781_thumb.jpg

  8. Very nice! Is there anyway to change the location from C:\ to a certain folder? I don't keep all of my scripts in the C: folder.

    Thanks,

    D

    You can change the folder: Open up the .pgf file in Notepad or another text editor, and edit these 2 lines to your liking with the full path:

    ...

    <Data.CurrentLocation>FileSystem::C:</Data.CurrentLocation>

    ...

    <Data.DrillDown.Script>C:\start-monitor.ps1 -s {gwmi win32_process -comp localhost}</Data.DrillDown.Script>

    ...

  9. OK, so you are talking about 2 issues?

    #1. When you do a PCAnywhere to your desktop, the gadgets don't appear as they should through your remote session?

    #2. When you reboot the desktop itself, the gadgets don't appear as they should when the system restarts?  Or is this a reboot done through PCAnywhere, and you are still viewing the gadgets through the remote session?

  10. I'll try to blog about it, but it could be a few weeks.  I've thought of a "wrapper" script that could interactively ask the user some questions and build the gauge that way, based on the answers provided. 

    Explaning how to create these extra gauges through the Creator would be too time consuming to cover in detail.  It did help me find the proper parameters though.

  11. Here, put this all on *one line* though (precede each new line below with a single space when you combine it all):

    get-wmiobject Win32_PerfRawData_PerfOS_Memory|out-gauge -mainvalue {$_.availablembytes} -InnerGauges_Add radial -InnerGauges_0_radialgauge_Value {$_.pagereadspersec} -InnerGauges_0_Layout_Target AnchorPoint -InnerGauges_0_Layout_AnchorPoint"-0.4,-0.4" -InnerGauges_Add radial -InnerGauges_1_radialgauge_Value {$_.writecopiespersec} -InnerGauges_1_Layout_Target AnchorPoint -InnerGauges_1_Layout_AnchorPoint "0.4,-0.4"

     [Edit: Mention that one needs to add a space to each line, e.g. from above is "-InnerGauges_Add[space]radial"]

  12. Sorry, where do these come from: ModifiedPageListBytes, StandbyCacheCoreBytes, StandbyCacheNormalPriorityBytes?

    I don't see them in Win32_PerfRawData_PerfOS_Memory on XP.

    Which one do you want in the main gauge?  I'm assuming you'd like to see the other values as "inner gauges"?

  13. Let me do some research on GetProcessWorkingSetSize/GetProcessWorkingSetSizeEx.  I like to think there's always a way, especially with PowerShell...

    It is pretty easy to incorporate several values into a signle gadget.  What would you like to see?  One main needle for the current total, then smaller inline needles/gauges representing other data?

  14. OK, so what you're wanting is:

    1. A needle to tell you the current value.

    2. Some smaller indicators of the current minimum and maximum values that WorkingSet has reached.  The values will change/reset if the current min or max is passed to their new values.

    I would think it would be easier to manage this within a PSH script, and pass the values off to out-gauge after.  That will require creating some custom objects.

    Do I have #1 and #2 right above?  From there, I can write something up hopefully today.

  15. Start with this:

    1. Copy the attached test.pgf.txt file to your system in C:\, and rename to test.pgf.

    2. Copy the start-monitor.ps1 script from here to C:\: http://thepowershellguy.com/blogs/posh/archive/2007/01/21/powershell-gui-scripblock-monitor-script.aspx. (I could attach it here if you have problems.)

    Copy both to the same location, double-click test.pgf which should start a gadget, then try double-clicking the gadget itself.

    This is a basic framework for what you've asked for.  Let me know what you think...

    In the next 2 weeks, I'll try to create a guest blog post on this.  You don't have access to the drilldown features from Creator, but there's a copy and paste trick that can help out here.

    [Edit: The original test.pgf puts the path and snap-ins as per my configuration.  Attached a new test.pgf referencing C:\ and removed the extra snap-ins I have loaded.]

  16. There isn't an option for single-click versus double-click, but a double-click/drilldown could open up a Windows form by simply calling a PowerShell script written to do so.  That being said, you might want to pass what was double-clicked on to the form somehow?

    Give me a slightly more detailed example, considering what I've said above...

    The resulting Windows form could have option buttons listed for you to do more specific tasks like you mention.

×
×
  • Create New...