SOLVED!!!

I was calling a HWInfo() function, which made several calls to WMIQuery(). It seemed to be failing consistently when calling the first WMIQuery function call (of about 12) in the HWInfo function. The HWInfo func only needed the first element of the array that WMIQuery was returning, so I wrote the code as:

Code:
 
$HW_01 = WMIQuery(long_string_of_stuff)[0]

; later...

$HWInfo = $HW_01, $HW_02 ...



I modified the HWInfo function to accept the entire array and then return just the first element:
Code:
 
$HW_01 = WMIQuery(long_string_of_stuff)

; later...

$HWInfo = $HW_01[0], $HW_02[0] ...



This now works.

What drove me nuts is that the first form worked until a server was queried, rebooted, and queried again from the same script instance. (the script itself invoked the remote reboot of the server).

OK - so now I know WHAT, but can anybody clue me in as to WHY??

Thanks!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D