Invoke-LenovoOneCLI
Description
Lenovo OneCLI is a comprehensive management utility that enables centralized discovery, inventory, and lifecycle management of firmware and driver updates for supported Lenovo servers and systems. It provides capabilities for scanning systems, downloading updates, and deploying firmware and driver patches across ThinkEdge, ThinkSystem, ThinkServer, and Wentian platforms.
Invoke-LenovoOneCLI.ps1 is a PowerShell wrapper that automates the deployment of Lenovo OneCLI by packaging it from a provided ZIP URL, caching it locally, and orchestrating its execution on supported Lenovo systems.
Requirements
- Windows PowerShell session with administrative privileges to install/import modules and write to
C:\ProgramData. - Internet connectivity to download the OneCLI ZIP package and PowerShell modules from PSGallery.
- Supported Lenovo system:
- Manufacturer must be Lenovo
- System model must be one of: ThinkEdge, ThinkSystem, ThinkServer, or Wentian
Process
- Bootstraps environment:
- Sets TLS/security settings
- Ensures
NuGetprovider exists - Installs or updates
Strapperand imports it
- Validates device eligibility:
- Exits if manufacturer is not Lenovo
- Exits if BIOS/product details do not match supported patterns
- Prepares working path:
C:\ProgramData\_Automation\App\Install-LXCE-OneCLI
- Tracks URL state:
- Reads previous URL from persistent store table
LXCE-OneCLI-URL - Re-downloads if URL changed, URL is missing, or
-Forceis used
- Reads previous URL from persistent store table
- Downloads and extracts payload:
- Saves ZIP as
Onecli.zip - Extracts to working directory
- Verifies
Onecli.exeexists
- Saves ZIP as
- Executes OneCLI:
- If
-Argumentis provided, runs custom argument string - Otherwise runs default command:
Onecli.exe update scan --output <workingDirectory>
- If
Payload Usage
This script downloads a payload URL containing the OneCLI executable. The payload must be a ZIP file containing Onecli.exe at the root or within a predictable directory structure after extraction.
Basic payload execution:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://example.com/Onecli.zip'
Force refresh payload even when URL is unchanged:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Force
Run with custom OneCLI arguments:
- Download all latest updates:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update acquire --mt 7Z73 --ostype win2022 --scope latest --dir C:\updates'
- Download only firmware updates:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update acquire --mt 7Z73 --ostype win2022 --scope latest --dir C:\updates --type fw'
- Download only Driver updates:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update acquire --mt 7Z73 --ostype win2022 --scope latest --dir C:\updates --type dd'
- Apply all downloaded updates:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update flash --dir C:\updates'
- Apply firmware only:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update flash --dir C:\updates --type fw'
- Apply Driver only:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update flash --dir C:\updates --type dd'
- Download and immediately apply all updates:
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update flash --mt 7Z73 --ostype win2022 --scope latest --dir C:\updates'
- With no reboot prompt (useful for scripting):
.\Invoke-LenovoOneCLI.ps1 -URL 'https://download.lenovo.com/servers/mig/2025/11/10/63602/lnvgy_utl_lxce_onecli01s-5.4.0_windows_indiv.zip' -Argument 'update flash --mt 7Z73 --ostype win2022 --scope latest --dir C:\updates --noreboot'
Notes:
- If no
-Argumentis specified, the script performs a default scan and lists available updates, storing results in the working directory. - If
-Argumentis provided, the script executesOnecli.exewith the specified arguments. - The OneCLI download URL is version-specific and changes when new releases are published. To obtain the latest URL, visit https://support.lenovo.com/solutions/lnvo-tcli, locate the OneCLI Windows Utility package in the downloads section, and copy the download link from the Payload Files section.
Parameters
| Parameter | Alias | Required | Default | Type | Description |
|---|---|---|---|---|---|
URL | None | Yes | None | String | URL for the OneCLI ZIP to download. Available from the Lenovo support website (https://support.lenovo.com/solutions/lnvo-tcli). |
Force | None | No | False | Switch | Forces download/extract even when the stored URL matches current URL. |
Argument | None | No | None | String | Custom argument string passed to Onecli.exe. If omitted, the script uses the default scan command. |
Output
- Script log output is written through
Write-Log(Strapper logging pipeline). - Primary working/output directory:
C:\ProgramData\_Automation\App\Install-LXCE-OneCLI
- Files generated/used in working directory include:
Onecli.zip(downloaded payload)Onecli.exe(extracted executable)- OneCLI scan/output files when default or custom
--outputpath targets this directory
Changelog
2026-04-14
- Initial version of the document