-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_installed_program.ps1
More file actions
27 lines (23 loc) · 953 Bytes
/
Copy pathcheck_installed_program.ps1
File metadata and controls
27 lines (23 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Check for all programs in both 32-bit and 64-bit uninstall registry paths matching the given program name
$ProgramName = "" # Running empty will list all programs
$programMatches = @()
$registryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
foreach ($path in $registryPaths) {
$apps = Get-ItemProperty $path -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -like "*$ProgramName*" } |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
if ($apps) {
$programMatches += $apps
}
}
if ($programMatches.Count -gt 0) {
Write-Host "$ProgramName Programs Installed:`n" -ForegroundColor Green
$programMatches | Format-Table -AutoSize
}
else {
Write-Output "No installed programs found matching: $ProgramName"
}