尝试获取所有已安装的更新(包括第三方应用程序的更新,例如Acrobat等),方法是单击控制面板中“程序和功能”中的“查看已安装的更新”。
以下方法无济于事,可能是因为它们仅限于Microsoft/Windows:
New-Object -ComObject Microsoft.Update.Session
Get-WmiObject Win32_QuickfixEngineering
Example: I want to get KB2565063 from attached image below谢谢
最佳答案
我发现以下选项:
$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*" }
这将返回一个对象,其中ParentDisplayName
是您的程序,DisplayVersion
是更新版本。
关于windows - 如何使用Powershell在控制面板中的 “view installed updates”中获取 “programs and features”列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64031829/