The following PowerShell script will display the properties information for any batteries available to the Windows system. The script makes use of the Windows Management Instrumentation (WMI) to fetch battery information and then presents it in a structured manner. Read-Host -Prompt "Press Enter to exit..."
The displayed battery information includes the battery name, manufacture name, serial number, manufacture date, power state (charging/discharging), current battery capacity, full charged capacity, voltage, charge/discharge rate, and more...
To successfully complete the query, a new battery tag is required. Acquire the tag using the IOCTL_BATTERY_QUERY_TAG operation. If a battery is present in that slot, the tag returned can be passed to any of the other battery IOCTLs to perform other functions.
Visit the directory. Click the battery health report HTML file. Upon tapping, the battery health report will open in your browser. It will show the battery specifications and capacity alongside the battery capacity history, life estimates, and recent usage stats.
To obtain information about the battery status, use the GetSystemPowerStatus function, which returns general information about all power sources in the system. You should use GetSystemPowerStatus whenever possible. In some cases, however, detailed information about each individual battery is necessary.
PowerShell will be open by default, so enter the following code and press Enter: Once the command is entered, PowerShell will tell you the name of the generated battery life report and where it has been saved on your computer. You can see here that it's named battery-report.html and is saved to the C drive. You can now close Windows Terminal.