Howdy Guys!
I am stuck with the Acrobat Reader verification and Installation script
The code needs to
- Ensure that Acrobat Reader has been installed. The minimum version is 9.5 If it is not installed, install it using the installer on E:\ Acrobat Reader W2008
- Attach screenshots.
I used the code as below but it isnt working out
$tempdir = Get-Location
$tempdir = $tempdir.tostring()
$appToMatch = ‘Acrobat Reader’
#$msiFile = $tempdir+“ADR.exe”
#The below location should be the location of the Acrobat File
$msiFile = C:\Temp\ADR.exe
$msiArgs = “-qb”
function Get-InstalledApps
{
if ([IntPtr]::Size -eq 4) {
$regpath = ‘HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall*’
}
else {
$regpath = @(
HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall*’
HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall*’
)
}
Get-ItemProperty $regpath | .{process{if($.DisplayName -and $.UninstallString) { $_ } }} | Select DisplayName, Publisher, InstallDate, DisplayVersion, UninstallString |Sort DisplayName
}
$result = Get-InstalledApps | where {$_.DisplayName -like $appToMatch}
If ($result -eq $null) {
(Start-Process -FilePath $msiFile -ArgumentList $msiArgs -Wait -Passthru).ExitCode
}
Please assist.