-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappDectection.ps1
More file actions
38 lines (32 loc) · 1.07 KB
/
appDectection.ps1
File metadata and controls
38 lines (32 loc) · 1.07 KB
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
28
29
30
31
32
33
34
35
36
37
38
Set-ExecutionPolicy -ExecutionPolicy Bypass
##Global Variable Declaration
[version]$InstallerVersion = '3.0'
#Application Name as it appears in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{appGUID}\DisplayName
#Append a * as a wildcard ex. '7-Zip*'
$AppName = 'Lipper*'
##32-Bit Detection
$32BitApp = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | where {$_.displayname -like $AppName}
Foreach ($item in $32BitApp)
{
[version]$InstalledVersion = $item.DisplayVersion
if ($InstalledVersion -ge $InstallerVersion)
{
Write-Host "Installed"
}
else
{
}
}
##64-Bit Detection
$64BitApp = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | where {$_.displayname -like $AppName}
Foreach ($item in $64BitApp)
{
[version]$InstalledVersion = $item.DisplayVersion
if ($InstalledVersion -ge $InstallerVersion)
{
Write-Host "Installed"
}
else
{
}
}