PowerTip: Use PowerShell to Show Remaining Battery Time

PowerTip: Use PowerShell to Show Remaining Battery Time

  • Comments 3
  • Likes

Summary: Use Windows PowerShell to show the percentage of remaining battery time.

Hey, Scripting Guy! Question How can I use Windows PowerShell to show the percentage of remaining battery time on my laptop or on my Windows Surface?

Hey, Scripting Guy! Answer Use the Get-WmiObject cmdlet and query the Win32_Battery WMI class:

(Get-WmiObject win32_battery).estimatedChargeRemaining

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Very handy, thanks!

  • So where is it? The VBS scripting Guy gave great examples.

  • @RH it is in the middle: (Get-WmiObject win32_battery).estimatedChargeRemaining is all the PowerShell code required to do this.