PowerTip: Use PowerShell to Show Remaining Battery Time


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

Comments (4)

  1. mredwilson says:

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

  2. DanielS says:

    Very handy, thanks!

  3. RH says:

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

  4. Pramod Raveendran says:

    Win32_Battery Get EstimatedChargeRemaining is not always shows accurate status, in some machine EstimatedChargeRemaining value shown as 171 or 106 when fully charged … any idea how to resolve this ?

Skip to main content