🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.os.windows-10
Article #121

Re: How can we get an ACCURATE list of unique programs installed on WIndows?

#121
From: Maria Sophia
Date: Sat, 10 Oct 2026 17:21
128 lines
6649 bytes
Paul wrote:
>> I've been on the Windows newsgroup for decades, and yet I don't think
>> anyone has ever asked this question...
> 
> You could try
> 
>    winget list
> 
> and that might be a superset of what is in Programs and Features control panel.
> 
> For portable or loose executables (not in TrustedInstaller folders),
> they could be just about anywhere.

Hi Paul,

I knew you'd be purposefully helpful, in that this is a valid technical 
question to ask what's the most accurate way to get all installed progs.

As you have suggested, I first tried winget which is a software package 
manager (similar to adb pm) and then I queried the registry for those 
well-behaved programs which put keys in the proper registry locations.

That worked within seconds, but now I've added JJ's useful suggestion of 
looking for portable apps by finding the exe in the installation path.

That made listapps v1p4 run tremendously slower than v1p4, so I don't 
know if the added "exe search" is worth the very much slower run times.

This finds over 1K lines of "apps" but I'm not yet sure of accuracy.
 # ---------------------------------------------------------------------
 # listapps.ps1
 # ---------------------------------------------------------------------
 # Reads the Windows Registry locations where installed programs often store
 # their uninstall information. It checks 32-bit and 64-bit programs, 
 # installed for the current user.
 # 
 # It also retrieves AppX packages for the current user using Get-AppxPackage.
 # 
 # The script keeps registry entries with a display name, selects the name,
 # version, and publisher, labels each entry by source, combines the results,
 # sorts them alphabetically, and exports them to one desktop CSV file.
 # 
 # To run: C:\> powershell -ExecutionPolicy Bypass -File listapps.ps1
 # ---------------------------------------------------------------------
 # v1p4 20261010 Added scans for C:\app executables as per JJ's suggestion.
 #               Note v1p3 runs much faster than v1p4 due to this exe scan.
 #               Added a 5th column (Path) to the CSV resulting in a row per 
 #               folder listing: Name, Version, Publisher, Source and Path
 # v1p3 20261010 Added to the CSV export a list of installed AppX packages
 # v1p2 20261010 Added description of how it works into the comment block.
 # v1p1 20261010 Output the list of installed apps to a desktop csv file
 # v1p0 20261010 List installed programs to the powershell command line
 #               One row per folder Name, Version, Publisher and Source 
 # ---------------------------------------------------------------------
 
 $paths = @(
   'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
   'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
   'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
 )
 
 $registryApps = Get-ItemProperty $paths -ErrorAction SilentlyContinue |
   Where-Object DisplayName |
   Select-Object `
     @{Name='Name'; Expression={$_.DisplayName}},
     @{Name='Version'; Expression={$_.DisplayVersion}},
     Publisher,
     @{Name='Source'; Expression={'Registry'}},
     @{Name='Path'; Expression={$_.InstallLocation}}
 
 $storeApps = Get-AppxPackage |
   Select-Object `
     @{Name='Name'; Expression={$_.Name}},
     @{Name='Version'; Expression={$_.Version.ToString()}},
     Publisher,
     @{Name='Source'; Expression={'AppX'}},
     @{Name='Path'; Expression={$_.InstallLocation}}
 
 $folderRoots = @(
   'C:\app',
   $env:ProgramFiles,
   ${env:ProgramFiles(x86)},
   "$env:LOCALAPPDATA\Programs",
   $env:APPDATA
 ) |
   Where-Object { $_ -and (Test-Path -LiteralPath $_) } |
   Select-Object -Unique
 
 $folderApps = foreach ($root in $folderRoots) {
   Get-ChildItem -LiteralPath $root -Directory -Recurse `
     -ErrorAction SilentlyContinue |
     ForEach-Object {
       $folder = $_
 
       $exe = Get-ChildItem -LiteralPath $folder.FullName -File `
         -Filter '*.exe' -ErrorAction SilentlyContinue |
         Where-Object {
           $_.Name -notmatch '^(unins|uninstall|setup|update|crash|helper)'
         } |
         Select-Object -First 1
 
       if ($exe) {
         $info = $exe.VersionInfo
 
         [PSCustomObject]@{
           Name      = $folder.Name
           Version   = $info.ProductVersion
           Publisher = $info.CompanyName
           Source    = 'FolderScan'
           Path      = $folder.FullName
         }
       }
     }
 }
 
 $folderApps = @($folderApps) |
   Sort-Object Path -Unique
 
 @($registryApps) + @($storeApps) + @($folderApps) |
   Sort-Object Name, Path |
   Export-Csv "$HOME\Desktop\InstalledPrograms.csv" -NoTypeInformation
 
 # end of listapps.ps1

The problem is it's giving too much information, so I'll cull it a bit.
Interestingly, Windows Defender thinks it's a PUP for some reason.
-- 
Usenet works because knowledgeable people take the time to help others.
Technical Details
Message-ID: <11ads7k$geq$1@nnrp.usenet.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-12.vpngate.v4.open.ad.jp!not-for-mail
References: <11abjg1$fb2$1@nnrp.usenet.blueworldhosting.com> <bj3qs8xw2mrd.1l1zhzw1pw1o7$.dlg@40tude.net> <11ad6mn$17o8$1@nnrp.usenet.blueworldhosting.com> <11adhdj$1pr6f$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-12.vpngate.v4.open.ad.jp!not-for-mail
From: Maria Sophia <mariasophia@comprehension.com>
Newsgroups: alt.comp.os.windows-10,alt.comp.os.windows-11,alt.msdos.batch
Subject: Re: How can we get an ACCURATE list of unique programs installed on WIndows?
Date: Sat, 10 Oct 2026 10:21:59 -0700
Organization: BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID: <11ads7k$geq$1@nnrp.usenet.blueworldhosting.com>
References: <11abjg1$fb2$1@nnrp.usenet.blueworldhosting.com> <bj3qs8xw2mrd.1l1zhzw1pw1o7$.dlg@40tude.net> <11ad6mn$17o8$1@nnrp.usenet.blueworldhosting.com> <11adhdj$1pr6f$1@dont-email.me>
Reply-To: pusvul@getTjewytR4so+mqe2.invalid
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 10 Oct 2026 17:22:01 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="l//KxG3Ge2LojWvwJg0Igv8F0ChK8RUC9RtOxMPUo3U"; posting-host="Dg8vEhE1wZBDJOwXTSEKAoRS4PU2oXroEpl9dza6STY";
	logging-data="16858"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mojibake 1p3
Cancel-Lock: sha1:dFpPu2pkVkarERcDyNvGwBg2nEE= sha256:5Pc340azUjP0oj0fsFldFowD0dO99vm1Qg1TFlp3SPU=
	sha1:41CVKh3SZ9lnGlQkJxGMDOcWHfo= sha256:7qeIVIIctF5/xnDnHbZTDO5rRySuzzazSuFvV3NIBos=
Posted-And-Mailed: yes
Content-Language: en-GB