I need to write a piece of code (script preferably) that tells if I have Adobe Reader installed and if it is, what it's version is. I think using PowerShell here would be right but i don't know.
Asked
Active
Viewed 4,449 times
1
-
What have you tried, and how has what you've tried failed? Ideally, you should provide a [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve) of what you've tried, and include specific information on how it failed, with error messages and/or erroneous output. SO is not a code-writing service; the best questions are those which provide useful information so that those who answer can guide you to devising your own correct answer. See [How to Ask a Good Question](https://stackoverflow.com/help/how-to-ask). – Jeff Zeitlin Aug 04 '17 at 11:14
-
Having said that, I will agree that PowerShell is probably your best bet, and you should read up on it, and on Windows Management Instrumentation/Interface (WMI); this is something that we've had to do in my organization. – Jeff Zeitlin Aug 04 '17 at 11:15
1 Answers
2
$query = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | select DisplayName,DisplayVersion | where {$_.DisplayName -like "*Gimp*"}
if ($query)
{
Write-Host "Adobe Reader is installed with the version $query.DisplayVersion .."
}
else
{
Write-Host "Adobe Reader is not installed.."
}

Robin
- 156
- 1
- 8