/powercfg Module to sum up all the Power consumption (Battery and AC)
powercfg /spr /output "c:\sleepy.xml" /xml /duration 1
Is there a better way to collect all the used Powerinformation and sum the mW number?
My Goal is to collect the total Powerconsumption (Battery and AC Usage) in total. The reason behind it is to have a report for a Officelocation and their estimated Powerusage due to Clients and Computers.
After creating the "sleepy.xml" file i usually do this in Powershell:
Step 1: Load the XML file with SPR
$xmlFilePath = "C:\sleepy.xml"
[xml]$xmlData = Get-Content $xmlFilePath
$xmlData.SleepStudy.ScenarioInstances.RecentUsageInstance.SrumData.PowerEstimationData.PowerEstimationRecord.TotalPowerConsumption | Measure-Object -Sum
That gives me a number around 100k. The problem here is that the number is based on the Batteryusage only. So the Value itself is not that helpful.
But when i try this expression the result is different:
$xmlData.SleepStudy.ScenarioInstances.RecentUsageInstance.SrumData.EnergyMeterData.EnergyMeterRecord.PowerConsumption | Measure-Object -Sum
Both seem in the end too little IF they are mW results.
I hope someone can help me to find a solution where i dont have to install a program and can only use commands in cmd or powershell and/or via VBS or .bat
Thank you in advance!
A.Guenes