View Single Post
Old 06-03-2008   #1 (permalink)
Victag


 
 

Call depth reached when calling function

Please help...I am calling this function to try and output a perf
counter value but I am getting call depth reached 101. I suspect I am
recursing the fuction but not sure how else to output the value of the
counter as the result of the function. Thanks in advance for any
advise.

Function PerfCounterValue()
{
#Connect to the local MSExchangeNMC Message Queued Outbound
Performance Counter to read value
$CounterDetail = "MSExchangeNMC","Message Queued Outbound","",
$Computer
$perf = New-Object
System.Diagnostics.PerformanceCounter($CounterDetail)
PerfCounterValue = $perf.RawValue
#Check for errors in case counter could not be accessed
ErrorCheck
}

$LastPerfCounterValue = PerfCounterValue
If ($LastPerfCounterValue -eq $null)
{Exit
}
My System SpecsSystem Spec