A lighweight powershell module for handling the battery mode for now. This repository is a fork from https://github.com/reagcz/IdeapadToolkit and all credits from communicating with the PowerBattery.dll go to reagcz.
- Probably any laptop that can be handled by Lenovo Vantage?
- Lenovo Notebook ITS Service running: check
services.msc - PowerBattery.dll
- This dll needs to be placed in the same directory as the executable
- Method C: release https://github.com/caiohamamura/PwshLenovoBattery/releases/download/v0.1/PowerBattery.dll
- Method A
- Install Lenovo Vantage from the Microsoft Store
- Copy it from C:\ProgramData\Lenovo\Vantage\Addins\IdeaNotebookAddin\ to the Ideapad Toolkit directory
- Lenovo Vantage can now be uninstalled
- Method B (Without Microsoft Store)
- Go to https://store.rg-adguard.net/
- Enter the link to Lenovo Vantage (https://apps.microsoft.com/store/detail/lenovo-vantage/9WZDNCRFJ4MV)
- Download the newest version in the .msixbundle format (The file should be called "something LevovoCompanion something .msixbundle)
- Open the .msixbundle file using 7Zip or similar software
- Inside 7Zip, navigate to LenovoVantagePackage[Version]x64.msix/DeployAssistant/ImController/Plugins[Version].cab/plugins.7z/Normal/IdeaNotebookPlugin/x64
- PowerBattery.dll should be in there
- Install-Module -Name LenovoBattery
- Download
PowerBattery.dllas from the previous section and put it somewhere in yourPATHenvironmental variable - Download the compiled module LenovoBattery.dll or compile from source using
dotnet build -c:Release - Put the compiled binary along with
PowerBattery.dllinside a Folder with the same nameLenovoBatterysomewhere in your$env:PSModulePath, usually in the$env:USERPROFILE\Documents\Powershell\Modules. - Now you can import it manually inside Powershell with
Import-Module LenovoBatteryor put it in your$PROFILE(a file which is started with powershell, usually in$env:USERPROFILE\Documents\Powershell\).
This module provides the following cmdlets:
Get-LevovoStatus
Get-LenovoChargingMode
Get-LenovoPowerPlan
Get-LenovoAlwaysOnUSB
Get-LenovoAlwaysOnUsbBattery
Set-LenovoChargingMode {Normal, Conservation, Rapid}
Set-LenovoPowerPlan {EfficiencyMode, ExtremePerformance, IntelligentCooling}
Set-LenovoAlwaysOnUSB {$true, $false}
Set-LenovoAlwaysOnUsbBattery {$true, $false}