PowerShell script creates an Alias command battery-report
to generate and manage battery reports based on powercfg tool.
- Script makes use of Microsoft.PowerShell_profile.ps1 file to make an executable command for PowerShell terminal to generate and manage battery report based of powercfg command-line tool:
- Manual Command:
powercfg /batteryreport /output <file>.html
# Download project
git clone https://github.com/umer-r/PSBatteryInfo.git
cd PSBatteryInfo
# Unblock and set execution policy bypass
Unblock-File -Path .\setup.ps1; PowerShell -ExecutionPolicy Bypass -File ".\setup.ps1"
# Run File
.\setup.ps1
- Restart PowerShell and then execute
battery-report