Skip to content

Instantly share code, notes, and snippets.

@mmdemirbas
mmdemirbas / battery.ps1
Created March 27, 2013 11:21
PowerShell script to help to keep laptop battery level in the specified range. Not automatically! You need to plug-in or unplug cable when you hear alert sound :) See: http://www.mmdemirbas.com/2013/03/monitor-remaining-battery-level-using.html
#########################################################################
# #
# Script to check battery state periodically and alert if it is #
# going to outside of the desired range (%40-%80) by default. #
# #
# Usage: #
# #
# # To alert if x<=40 or x>=80, and check each 15 sec #
# #
# .\battery.ps1 40 80 15 #