Jump to content
Software FX Community
cmorrall

Does Powershell 2 break out-gauge?

Recommended Posts

I recently upgraded to PowerShell 2.0 on my WIndows XP box. A script that previously worked now does not.

The script is a simple test:

Add-PSSnapin PowerGadgets

get-wmiobject Win32_PerfFormattedData_PerfOS_Processor | where {$_.Name -eq "_Total"} | select InterruptsPersec,PercentProcessorTime,PercentInterruptTime,PercentPrivilegedTime,PercentUserTime | out-gauge -refresh 0:0:2 -template test1.pgt -Scales_1_Indicators_0_Value {$_.PercentProcessorTime} -innerGauges_0_RadialGauge_Value {$_.PercentInterruptTime} -innerGauges_1_RadialGauge_Value {$_.PercentPrivilegedTime} -Scales_2_Indicators_0_Value {$_.PercentUserTime}

This now throws an error:

Out-Gauge : Object reference not set to an instance of an object.

I read something about what's new in PowerShell 2.0

http://technet.microsoft.com/en-us/library/dd871148(WS.10).aspx#BKMK_PS20

"Native commands that generate a user interface cannot be piped to the Out-Host cmdlet."

Could this be related?

Share this post


Link to post
Share on other sites

I tested your script using our most recent build and it worked fine (I got some warnings because I do not have your template but got no exceptions). I understand we should be pushing a new service pack in a day or 2. If you do not see build 3588 or later available please let me know and we can send you a zip file while we work out the site.

JuanC

post-7336-13922413076265_thumb.jpg

Share this post


Link to post
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.

Loading...

×
×
  • Create New...