![](/img/trans.png)
[英]How can I uninstall Software Update (Programs and Features\Installed Updates) with 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
謝謝
我發現了以下選項:
$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
謝謝
我假設您想要包含 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.