Open Source Windows UPS Monitor and Shutdown utility: Watch-Win32_UPS

What is Watch-Win32_UPS

Watch-Win32_UPS is a utility written in PowerShell (v 7.1) that taps into the Windows Win32_Battery class in order to provide the following functions:

  • Logging functions
  • Action script

Action Script

The purpose of the action script is normally to shutdown the computer. It is invoked when the power supply is off and trigger points (percentage capacity and remaining time) fall below specified values.

PowerShell 7

PowerShell 7 or above is required to run this script. This version of PowerShell does not come installed by default on Windows.

How to set up Watch-Win32_UPS to run automatically when the computer boots

Task Scheduler will be used to program a task that will run on computer start up and invoke Watch-Win32_UPS PowerShell script.

  • Shutdown Script
  • Log file settings

30+ years' experience in the field of IT in the Financial (Insurance / Banking), Services and Education industries.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store