May 1st, 2013

PowerTip: Use PowerShell to Show Remaining Battery Time

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.