##Make a Powershell Script …
battlev.ps1
return (Get-WMIObject Win32_Battery -ea 0).EstimatedChargeRemaining
##Make a BAT file…
battery.bat
@echo off
D:
CD D:\Programs\POS
for /f "delims=" %%a in ('powershell -executionpolicy bypass -File .\battlev.ps1') do Set "errorlevel=%%a"
exit %errorlevel%
##Make a JScript function …
Handler: pshell
function batt() {
var batFile = "D:\\Programs\\POS\\battery.bat";
var r = file.For(batFile).Starter().Hidden.ShellExecute();
return r;
}
##Create Action to store value …
##BATT Store Level
[Update Program Setting](Action)##
| Action Name: | BATT Store Level |
| Action Type: | Update Program Setting |
| Setting Name: | [:settingName] |
| Setting Value: | [:settingValue] |
| Update Type: | Update |
| Is Local: | True |
##Create Action to Execute Automation Command…
##BATT ExecAMC
[Execute Automation Command](Action)##
| Action Name: | BATT ExecAMC |
| Action Type: | Execute Automation Command |
| Automation Command Name: | [:AMCname] |
| Command Value: | [:AMCvalue] |
| Background: | [:runBG] |
| Delay: | [:delay] |
##Create Action to update Application Subtitle …
##AST Update Application Subtitle
[Update Application Subtitle](Action)##
| Action Name: | AST Update Application Subtitle |
| Action Type: | Update Application Subtitle |
| Title Location: | Shell Header |
| Title: | [:content] |
| Background: | [:bg] |
| Height: | [:height] |
| Refresh Asnyc: | [:refreshAsync] |
##Create a Trigger …

##Rule to handle Trigger …
##BATT Trigger
[Trigger Executed](Rule)##
| Rule Name: | BATT Trigger |
| Event Name: | Trigger Executed |
| Rule Tags: | |
| Execute Rule if: | Matches |
Trigger Name | Equals | BATT Trigger |
##Actions (1):##
BATT ExecAMC
Constraint: (none)
| AMCname: | BATT Update |
| AMCvalue: | |
| runBG: | True |
| delay: | 0 |
##Mappings##
Mappings
| Terminal | User Role | Department | Ticket Type |
| | | |
##Rule to handle Automation Command and update Subtitle …
##BATT Update
[Automation Command Executed](Rule)##
| Rule Name: | BATT Update |
| Event Name: | Automation Command Executed |
| Rule Tags: | |
| Execute Rule if: | Matches |
Automation Command Name | Equals | BATT Update |
##Actions (2):##
BATT Store Level
Constraint: (none)
| settingName: | BatteryLevel |
| settingValue: | {CALL:pshell.batt()} |
AST Update Application Subtitle
Constraint: (none)
| content: |
(see below) |
| bg: | |
| height: | |
| refreshAsync: | |
content:
<size 18><font Consolas><color Yellow>BATT:{SETTING:BatteryLevel}%</color></font></size>
##Mappings##
Mappings
| Terminal | User Role | Department | Ticket Type |
| | | |





