Sha256: 8418a8648992f585da582031838924e6fa71413e8ec485734c4c883756b6e991

Contents?: true

Size: 1.27 KB

Versions: 243

Compression:

Stored size: 1.27 KB

Contents

function FindInstalledApplication
{
  param($appName, $appVersion)
    
  if ((Get-WmiObject win32_operatingsystem).OSArchitecture -notmatch '64')  
  { 
    $keys= (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*')
    $possible_path= 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
    if (Test-Path $possible_path)
    {
      $keys+= (Get-ItemProperty $possible_path)
    }
  }  
    else  
  { 
    $keys = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*')
    $possible_path= 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
    if (Test-Path $possible_path)
    {
      $keys+= (Get-ItemProperty $possible_path)
    }
    $possible_path= 'HKCU:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
    if (Test-Path $possible_path)
    {
      $keys+= (Get-ItemProperty $possible_path)
    }
  }

  if ($appVersion -eq $null) { 
    @($keys | Where-Object {$_.DisplayName -like $appName -or $_.PSChildName -like $appName}).Length -gt 0
  }
  else{
    @($keys | Where-Object {$_.DisplayName -like $appName -or $_.PSChildName -like $appName  } | Where-Object {$_.DisplayVersion -eq $appVersion} ).Length -gt 0
  }

}

Version data entries

243 entries across 243 versions & 3 rubygems

Version Path
specinfra-2.91.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.90.1 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.90.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.89.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.88.2 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.88.1 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.88.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.87.2 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.87.1 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.87.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.86.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.85.1 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.85.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.84.1 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.84.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.83.4 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.83.3 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.83.2 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.83.1 lib/specinfra/backend/powershell/support/find_installed_application.ps1
specinfra-2.83.0 lib/specinfra/backend/powershell/support/find_installed_application.ps1