簡體   English   中英

如何使用 Powershell 在控制面板的“程序和功能”中獲取“查看已安裝的更新”列表?

[英]How to get list of "view installed updates" in "programs and features" in control panel using Powershell?

嘗試獲取所有已安裝的更新(包括 Acrobat 等第三方應用程序的更新),可以通過單擊控制面板中“程序和功能”中的“查看已安裝的更新”來查看。

以下方法沒有幫助,可能是因為它們僅限於 Microsoft/Windows:

New-Object -ComObject Microsoft.Update.Session
Get-WmiObject Win32_QuickfixEngineering

示例:我想從下面的附圖中獲取 KB2565063

謝謝

我發現了以下選項:

$x = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -like "*foo*" }
$y = Get-ItemProperty HKLM:\SOFTWARE\Classes\Installer\Dependencies\* | Where-Object {$_.DisplayName -like "*foo*" }

在 $x 中,您擁有來自“卸載程序”的軟件,而在 $y 中,您擁有來自“已安裝更新”的更新。

我對此不是很滿意,我想知道 windows 如何在不簡單地搜索名稱的情況下將 $x 和 $y 鏈接在一起。

也許有人可以為我們修復缺失的部分:-)

編輯

我找到了解決方案:

Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.ParentDisplayName -like "*foo*" }

這將返回 object,其中ParentDisplayName是您的程序, DisplayVersion是更新版本。

嘗試獲取所有已安裝的更新(包括 Acrobat 等第三方應用程序的更新),可以通過單擊控制面板中“程序和功能”中的“查看已安裝的更新”來查看這些更新。

以下方法沒有幫助,可能是因為它們僅限於 Microsoft/Windows:

New-Object -ComObject Microsoft.Update.Session
Get-WmiObject Win32_QuickfixEngineering

示例:我想從下面的附圖中獲取 KB2565063

謝謝

我假設您想要包含 msu 提供商的軟件包:

get-package -ProviderName msu


Name                           Version          Source                     ProviderName
----                           -------          ------                     ------------
Update for Microsoft Defend...                                             msu
Security Intelligence Updat...                                             msu
Security Intelligence Updat...                                             msu

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM