I have some simple code:
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("select * from Win32_UninterruptiblePowerSupply");
ManagementObjectCollection items = searcher.Get();
foreach (ManagementObject item in items)
{
// Some code here...
}
The "items" object is semi-null. It's actually an object, but a call to .Count or anything else throws an exception.
I do have a standard USB-compliant UPS hooked up, this is Windows 7, and I'm using Visual Studio 2010 on a 64-bit machine. I did add a manifest and requireAdministrator too.
Other WMI classes work, but this one doesn't. I'm out of ideas - help!