PowerTip: Generate an HTML Battery-Life Report in PowerShell

PowerTip: Generate an HTML Battery-Life Report in PowerShell

  • Comments 5
  • Likes

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

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Does not work with  /batteryreport  Invalid Parameter    Powercfg -energy works ok for a full HTML report.

    Running V3 WIN 7

  • @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 :-)

  • @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('.')

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

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