Actually fix Issue #558

This commit is contained in:
Chris Long
2020-11-15 08:46:44 -08:00
committed by GitHub
parent aa787f22c0
commit cf336b578a

View File

@@ -31,9 +31,14 @@ function install_checker {
param(
[string]$Name
)
$results = Get-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' | where { ($_.Publisher -eq 'VMware, Inc.') -OR ($_.Publisher -eq 'Oracle Corporation') -OR ($_.Publisher -eq 'HashiCorp')} | Select-Object DisplayName
$results += Get-ItemProperty 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' | where { ($_.Publisher -eq 'VMware, Inc.') -OR ($_.Publisher -eq 'Oracle Corporation') -OR ($_.Publisher -eq 'HashiCorp') } | Select-Object DisplayName
$results = @()
Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
ForEach-Object {
$obj = New-Object psobject
Add-Member -InputObject $obj -MemberType NoteProperty -Name GUID -Value $_.pschildname
Add-Member -InputObject $obj -MemberType NoteProperty -Name DisplayName -Value $_.GetValue("DisplayName")
$results += $obj
}
forEach ($result in $results) {
if ($result -like "*$Name*") {
return $true