Get-LnvUpdateFromWmi#
Queries Lenovo update information from the WMI repository on the local or remote computer.
Synopsis#
Retrieves update information stored in WMI by the Install-LnvUpdate cmdlet using the root\Lenovo\Lenovo_Updates class.
Syntax#
Get-LnvUpdateFromWmi [-ComputerName <string>] [-Status <string>]
[-Severity <string>] [-IncludeHistory]
Description#
Get-LnvUpdateFromWmi queries the Lenovo_Updates WMI class to retrieve update installation records. This is useful for auditing, compliance reporting, and verifying installation history across systems.
Results can be filtered by status (Applicable, Installed, NotApplicable) and severity level. The -IncludeHistory parameter retrieves the last 10 installation records for historical tracking.
Parameters#
| Parameter | Type | Default | Description |
|---|---|---|---|
-ComputerName |
string | $env:COMPUTERNAME | Local or remote computer name |
-Status |
string | - | Filter by status: Applicable, Installed, NotApplicable |
-Severity |
string | - | Filter by severity: Critical, Recommended, Optional |
-IncludeHistory |
switch | - | Include last 10 installation records |
Examples#
Example 1: Query local computer updates#
Retrieves all update entries from the local computer.
Example 2: Query only applicable updates#
Filters for updates that are applicable but not yet installed.
Example 3: Query critical updates on remote computer#
Retrieves critical-severity updates from a remote system.
Example 4: Include installation history#
Retrieves current status plus last 10 installation records.
Output#
Returns WMI objects with properties such as:
Title- Update package nameVersion- Package versionStatus- Current status (Applicable, Installed, NotApplicable)Severity- Update severity levelSize- Package size in bytesInstallDate- Installation date and timeMessage- Additional status or error information
Notes#
- WMI queries use the
root\Lenovo\Lenovo_Updatesnamespace - Remote queries require appropriate WMI permissions on the target computer
- History limited to 10 most recent entries when
-IncludeHistoryis used - Color-coded console output: Cyan (queries), Green (success), Yellow (headers), Gray (details)