cmorrall Posted March 1, 2010 Report Share Posted March 1, 2010 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? Quote Link to comment Share on other sites More sharing options...
marco.shaw Posted March 1, 2010 Report Share Posted March 1, 2010 Not a definite answer, but I suspect there may be problems with using scriptblocks for parameter values with PowerGadgets and PowerShell v2. Quote Link to comment Share on other sites More sharing options...
cmorrall Posted March 1, 2010 Author Report Share Posted March 1, 2010 If I put it another way; isn't this quite the showstopper for PowerGadgets? Or is there another reasonably simple way of sending values to out-gage? Quote Link to comment Share on other sites More sharing options...
JuanC Posted March 1, 2010 Report Share Posted March 1, 2010 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 Quote Link to comment Share on other sites More sharing options...
cmorrall Posted March 1, 2010 Author Report Share Posted March 1, 2010 I have build 1.0.3049.17915, which I just pulled from your site. 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.