Вот код, который я иногда использую (не слишком часто, так что ...).Подробности см. В комментариях к справке.
<#
.SYNOPSIS
Gets uninstall records from the registry.
.DESCRIPTION
This function returns information similar to the "Add or remove programs"
Windows tool. The function normally works much faster and gets some more
information.
Another way to get installed products is: Get-WmiObject Win32_Product. But
this command is usually slow and it returns only products installed by
Windows Installer.
x64 notes. 32 bit process: this function does not get installed 64 bit
products. 64 bit process: this function gets both 32 and 64 bit products.
#>
function Get-Uninstall
{
# paths: x86 and x64 registry keys are different
if ([IntPtr]::Size -eq 4) {
$path = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
}
else {
$path = @(
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
)
}
# get all data
Get-ItemProperty $path |
# use only with name and unistall information
.{process{ if ($_.DisplayName -and $_.UninstallString) { $_ } }} |
# select more or less common subset of properties
Select-Object DisplayName, Publisher, InstallDate, DisplayVersion, HelpLink, UninstallString |
# and finally sort by name
Sort-Object DisplayName
}
Get-Uninstall