Skip to content

caiohamamura/PwshLenovoBattery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lenovo Battery Powershell Module

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.

Supported laptops

  • Probably any laptop that can be handled by Lenovo Vantage?

Prerequisites

  • Lenovo Notebook ITS Service running: check services.msc
  • PowerBattery.dll
    • This dll needs to be placed in the same directory as the executable

How to get PowerBattery.dll

Installing this Module

Option 1: Powershell Gallery

  1. Install-Module -Name LenovoBattery

Option 2: Compile from source

  1. Download PowerBattery.dll as from the previous section and put it somewhere in your PATH environmental variable
  2. Download the compiled module LenovoBattery.dll or compile from source using dotnet build -c:Release
  3. Put the compiled binary along with PowerBattery.dll inside a Folder with the same name LenovoBattery somewhere in your $env:PSModulePath, usually in the $env:USERPROFILE\Documents\Powershell\Modules.
  4. Now you can import it manually inside Powershell with Import-Module LenovoBattery or put it in your $PROFILE (a file which is started with powershell, usually in $env:USERPROFILE\Documents\Powershell\).

Usage

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}

Third party licenses

reagcz/IdeapadToolkit

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors