Git Product home page Git Product logo

lsuclient's Introduction

LSUClient PowerShell Module PNG Logo

LSUClient

PowerShell Gallery
A PowerShell module that partially reimplements the "Lenovo System Update" program for convenient, automatable and worry-free driver and system updates for Lenovo computers.

Install-Module -Name 'LSUClient'

Highlight features

  • Does driver, BIOS/UEFI and firmware updates
  • Run locally or through PowerShell remoting on another machine
  • Allows for fully silent and unattended updates
  • Supports not only business computers but consumer lines too (e.g. IdeaPad)
  • Full Web-Proxy support including authentication
  • Concise, helpful and easy-to-read output
  • Ability to download updates in parallel
  • Accounts for and works around some bugs and mistakes in the official tool
  • Free and open-source

Examples and tips

See available updates:

Get-LSUpdate

Find, download and install available updates:

$updates = Get-LSUpdate
$updates | Save-LSUpdate -ShowProgress
$updates | Install-LSUpdate -Verbose

Install only packages that can be installed silently and non-interactively:

$updates = Get-LSUpdate | Where-Object { $_.Installer.Unattended }
$updates | Save-LSUpdate -Verbose
$updates | Install-LSUpdate -Verbose

Filtering out non-unattended packages like this is recommended when using this module in MDT, SCCM, remote execution via PowerShell Remoting, ssh or any other situation in which you run these commands remotely or as part of an automated process. Packages with installers that are not unattended may attempt to start a GUI setup on the machine and, if successful, wait until someone clicks through the dialogs.

To get all available packages:

$updates = Get-LSUpdate -All

By default, Get-LSUpdate only returns "needed" updates. Needed updates are those that are applicable to the system and not yet installed. If you want to see all available packages instead, use Get-LSUpdate -All. To filter out unneeded packages later, just look at the IsApplicable and IsInstalled properties. The default logic is equivalent to: Get-LSUpdate -All | Where-Object { $_.IsApplicable -and -not $_.IsInstalled }

Download drivers for another computer:

Get-LSUpdate -Model 20LS -All | Save-LSUpdate -Path 'C:\20LS_Drivers' -ShowProgress

Using the -Model parameter of Get-LSUpdate you can retrieve packages for another computer model. In this case you almost always want to use -All too so that the packages found are not filtered against your computer and all packages are downloaded.

Dealing with BIOS/UEFI updates

It is important to know that some Lenovo computers require a reboot to apply BIOS updates while other models require a shutdown - the BIOS will then wake the machine from the power-off state, apply the update and boot into Windows. So as to not interrupt a deployment or someone working, this module will never initiate reboots or shutdowns on its own - however it's easy for you to:

  1. Run Install-LSUpdate with the -SaveBIOSUpdateInfoToRegistry switch
  2. If any BIOS/UEFI update was successfully installed this switch will write some information to the registry under HKLM\Software\LSUClient\BIOSUpdate, including the String "ActionNeeded" which will contain "REBOOT" or "SHUTDOWN" depending on which is required to apply the update.
  3. At any later point during your script, task sequence or deployment package you can check for and read this registry-key and gracefully initiate the power-cycle on your terms. I recommend clearing the registry values under HKLM\Software\LSUClient\BIOSUpdate afterwards so you know the update is no longer pending.

If you want to exclude BIOS/UEFI updates, simply do so by their category:

$updates = Get-LSUpdate | Where-Object { $_.Category -ne 'BIOS UEFI' }

For more details, available parameters and guidance on how to use them run Get-Help on the functions in this module.

Misc

  • Only Windows 10 is supported
  • This module does not clean up downloaded packages at any point. This is by design as it checks for previously downloaded packages and skips them. The default download location is $env:TEMP\LSUPackages - you may delete it yourself
  • This module requires internet access to https://download.lenovo.com and must be able to download .xml, .exe and .inf files from that domain - there is no official offline mode yet (see #17)
  • If you explicitly Save-LSUpdate before using Install-LSUpdate the whole operation will be faster because when calling Save-LSUpdate explicitly it downloads the packages in parallel, but calling Install-LSUpdate first will download then install each package after the other

lsuclient's People

Contributors

badbart avatar jantari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.