【问题标题】:Windows Command Line To View Installed Software Hotfixes/Patches用于查看已安装软件修补程序/修补程序的 Windows 命令行
【发布时间】:2021-04-27 03:14:53
【问题描述】:

在 Windows 上,导航到 控制面板 > 程序和功能 > 查看已安装的更新 页面,我可以看到所有应用的软件修补程序,包括 Windows 更新。

我想使用命令查看此信息。使用以下命令,我可以查看应用的所有 Windows 更新:

wmic qfe list full

唯一的问题是,上面的命令没有列出应用于机器的软件设备补丁。例如,在查看已安装的更新页面上,我可以看到为 SolarWinds 应用的补丁,而我在命令行中看不到相同的信息。

【问题讨论】:

标签: windows command wmic hotfix installed-applications


【解决方案1】:

参考Skipping last empty line of WMIC command output in batch

@echo off
Title wmic to get HotfixID
Setlocal EnableDelayedExpansion
echo "patches" : {
set "patches=wmic qfe get HotfixID"
for /f "skip=1" %%i in ('%patches%') do for /f "delims=" %%j in ("%%i") do (
    set /a count=count+1
    echo "!count!" : "%%j",
)
echo }

使用Powershell 7.1,参考Get-Package,可以试试Powershell:

Get-Package -AllVersions

Getting List of Installed Applications that Matches Add/Remove Programs List


参考group all installed software in one cell by PowerShell

(Get-Package | Where-Object {$_.ProviderName -in @('Programs','msi','Chocolatey')} | Select-Object -ExpandProperty Name)

【讨论】:

    猜你喜欢
    • 2019-06-20
    • 1970-01-01
    • 1970-01-01
    • 2017-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-27
    • 1970-01-01
    相关资源
    最近更新 更多