尝试获取所有已安装的更新(包括Acrobat等第三方应用程序的更新(,点击";查看已安装的更新";在";程序和功能";在控制面板中。
以下方法没有帮助,可能是因为它们仅限于Microsoft/Windows:
New-Object -ComObject Microsoft.Update.Session
Get-WmiObject Win32_QuickfixEngineering
示例:我想从下面的附加图像中获得KB2565063
感谢
我发现了以下选项:
$x = Get-ItemProperty HKLM:SoftwareMicrosoftWindowsCurrentVersionUninstall* | Where-Object { $_.DisplayName -like "*foo*" }
$y = Get-ItemProperty HKLM:SOFTWAREClassesInstallerDependencies* | Where-Object {$_.DisplayName -like "*foo*" }
在$x中,您可以从";卸载程序";并且在$y中,您具有来自";已安装的更新";。
我对此不太满意,我想知道windows是如何在不搜索名称的情况下将$x和$y链接在一起的。
也许有人可以为我们修复缺失的部分:-(
编辑
我找到了解决方案:
Get-ItemProperty HKLM:SoftwareWOW6432NodeMicrosoftWindowsCurrentVersionUninstall* | Where-Object { $_.ParentDisplayName -like "*foo*" }
这将返回一个对象,其中ParentDisplayName
是您的程序,DisplayVersion
是更新版本。
我假设您想要带有msu提供程序的包:
get-package -ProviderName msu
Name Version Source ProviderName
---- ------- ------ ------------
Update for Microsoft Defend... msu
Security Intelligence Updat... msu
Security Intelligence Updat... msu