-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathListInstalledPrograms.ps1
executable file
·36 lines (32 loc) · 1.24 KB
/
ListInstalledPrograms.ps1
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
# https://github.com/3gstudent/ListInstalledPrograms/blob/master/ListInstalledPrograms.ps1
<#
.SYNOPSIS
This script can be used to list the programs that the current Windows system has installed.
Supprot x86 and x64
Author: 3gstudent@3gstudent
License: BSD 3-Clause
#>
Function ListPrograms {
param($RegPath)
$QueryPath = Get-ChildItem $RegPath -Name
foreach($Name in $QueryPath) {
(Get-ItemProperty -Path $RegPath$Name).DisplayName
# (Get-ItemProperty -Path $RegPath$Name).Publisher
# (Get-ItemProperty -Path $RegPath$Name).DisplayVersion
}
}
if ([IntPtr]::Size -eq 8) {
Write-Host "[*] OS: x64"
Write-Host "[*] List the 64 bit programs that have been installed"
$RegPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
ListPrograms -RegPath $RegPath
Write-Host "[+] List the 32 bit programs that have been installed"
$RegPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
ListPrograms -RegPath $RegPath
}
else {
Write-Host "[*] OS: x86"
Write-Host "[*] List the 32 bit programs that have been installed"
$RegPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
ListPrograms -RegPath $RegPath
}