Revise Exec Path Check in ExtractPrograms.ps1

This commit is contained in:
Rohan Barar 2024-09-02 12:15:02 +10:00
parent e224e233cc
commit 3a0acff38f

View File

@ -180,6 +180,7 @@ function AppSearchWinReg {
# Initialise empty arrays.
$exeNames = @()
$exePaths = @()
$validPaths = @()
# Query windows registry for unique installed executable files.
$exePaths = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\*" |
@ -193,12 +194,13 @@ function AppSearchWinReg {
# Get corresponding application names for unique installed executable files.
foreach ($exePath in $exePaths) {
if (Test-Path -Path $exePath) {
$validPaths += $exePath
$exeNames += GetApplicationName -exePath $exePath
}
}
# Process extracted executable file paths.
PrintArrayData -Names $exeNames -Paths $exePaths -Source "winreg"
PrintArrayData -Names $exeNames -Paths $validPaths -Source "winreg"
}
# Name: 'AppSearchUWP'