You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute> <displayName>Battery Time Remaining</displayName> <displayInCategory>System Information</displayInCategory> <dataType>integer</dataType> <description>This attribute returns number of minutes of battery charge remaining, if a battery is installed. This attribute applies to both Mac and Windows.</description> <scriptContentsMac>#!/bin/shecho "<result>$(ioreg -r -c "AppleSmartBattery" | grep -w "TimeRemaining" | awk '{print $3}' | sed s/\"//g)</result>" </scriptContentsMac> <scriptTypeWindows>VBScript</scriptTypeWindows> <scriptContentsWindows>On Error Resume Next Dim objBatteriesDim strBatteries Set objBatteries = GetObject("winmgmts:").InstancesOf("Win32_Battery")i=0For each Battery in objBatteriesif i <> 0 thenstrBatteries = "<br>" & strBatteriesEnd If strBatteries = Battery.EstimatedRunTime & strBatteriesi=i+1NextWScript.Echo "<result>" & strBatteries & "</result>"</scriptContentsWindows></extensionAttribute>