PowerTip: Generate an HTML Battery-Life Report in PowerShell

Summary: Use Windows PowerShell and generate an HTML battery-life report.

Hey, Scripting Guy! Question How can I generate an HTML battery-life report on my laptop to see expected battery life?

Hey, Scripting Guy! Answer Open Windows PowerShell as an administrator and type the following command:

powercfg /batteryreport

The command reports a destination for the report that you open by using the Invoke-Item cmdlet (ii is an alias):

ii C:\battery-report.html

Comments (5)

  1. jrv says:

    @Ed –

    Invoke -Item seems  little aggressive for this.  How about keeping it al on one line.

    &(powercfg /batteryreport).Replace('Battery life report saved to ','').TrimEnd('.')

  2. jrv says:

    @Ed – I always seem to end up with three 'i's and my eyes can see only two.  Fat characters '&' are better for me.

  3. Tim Bolton says:

    Does not work with  /batteryreport  Invalid Parameter    Powercfg -energy works ok for a full HTML report.

    Running V3 WIN 7

  4. Ed Wilson says:

    @Tim Bolton … hmm. I am running Windows 8, must have added the batteryreport parameter. Yes, the energy report is impressive. I use it when I want to figure out if the electricity went off while I was gone 🙂

  5. Ed Wilson says:

    @JRV yes the invocation operator works just fine. It is just that, for me, ii is easier to type than <shift>7 🙂

Skip to main content