![]() ![]() ![]() That sounds odd but it can be explained by an example. It looks like you have to dig into MSBattery super class:Ī number of the classes in root\wmi return results from more than oneĬlass. I could generate the powercfg report and then parse it, but I really don't want to implement an ugly workaround when there is most likely a "right" way to do it that is just escaping me. NET, or Powershell way to do this, I'd like to know about it. ![]() There must be some programmatic way to access this information, because powercfg is doing it. It seemed likely that this data should be in WMI, and sure enough, there's a Win32_Battery class having DesignCapacity and FullChargeCapacity fields, but on all the systems I have tested, they are undefined: PS C:\Users\superuser> Get-WmiObject -Class Win32_Battery | Select-Object -Property *Capacity | Format-List Moreover, I can boot into this laptop's built-in diagnostic environment and it displays similar figures, and the discharge cycle count of the battery.įrom where are these values being obtained? I would like to be able to track this battery life data over time for a fleet of laptops, preferably from a Powershell script. The HTML report is generated instantaneously and displays, among others, the statistics I'm interested in: C:\Users\superuser\AppData\Local\Temp>powercfg /batteryreportīattery life report saved to C:\Users\superuser\AppData\Local\Temp\battery-report.html On Windows 10 (among other versions) running on a device having a battery, I can use powercfg /batteryreport to obtain the "Design Capacity" and "Last Full Charge Capacity" for the battery, which give an idea of the remaining useful service life of the battery and how much its capacity has degraded from use. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |