Friday, May 03, 2013

PowerTip: Use PowerShell to Show Remaining Battery Time - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs

Show the remaining battery charge (Percentage) using PowerShell.
(Get-WmiObject win32_battery).estimatedChargeRemaining
Want to know what other properties can be looked up?
Get-WmiObject win32_battery | Get-Member
Quick Tip: Win32_Battery class only works if you have a battery in the system to report on (i.e the above code will work on laptops not desktops)


PowerTip: Use PowerShell to Show Remaining Battery Time - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs: "(Get-WmiObject win32_battery).estimatedChargeRemaining"

'via Blog this'

No comments :

Post a comment