Try our new Certificate Revocation List Check Tool
CRLcheck.exe is a tool developed to verify digital signatures of executable files. It collects files from known paths on your client, checks their signature, and checks Certificate Revocation Lists (CRL) and OCSP download. This helps avoid delays in launching files.
Category published:  Deployment Scripting   Click on the Category button to get more articles regarding that product.

Powershell, Retrieve DisplayName,DisplayVersion,Publisher from Registry or export.REG

Posted by admin on 05.09.2023

Hello,

You need and easy way to get an inventory list of software installed on a machine via Powershell. What we need for a list is:

DisplayName;DisplayVersion;Publisher


We have two version of the scripts:

Version 1 Use regedit and export the HIVES into .REG Files. Copy to your admin machine an then parse the two files with the script. Use this where you are not allowded to run PS on Servers because of compliance (Signed/external source etc.)
Version 2 Directly access the Registry 32/64BIT Hive Uninstall info on local machine and generate an output.txt file.

Here is how to easily extract the most important information from a .REG export from the UNINSTALL Registry HIVE. We don’t want to run the PS directly on the server or via the server because of compliance. So, you can export the Registry Hives from a server as a .REG file, transport them through valid methods to the management machine, and then generate a semicolon-separated list for Excel import.

At the bottom, you will find a version we made if you want to retrieve the info directly from the local machine and directly from the Registry Hives (Without the way over the .REG export) (32 and 64-bit Hives):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Version 1

C:\edv\00_modern_workplace\software32.reg

C:\edv\00_modern_workplace\software64.reg

# www.butsch.ch

# Version 1 Import from .REG File which was exported on machine/server

# V1.0, 03.09.2023, First Release

(Get-Content -Path ‘C:\edv\00_modern_workplace\software.reg’ -Raw) -split ‘\r?\n\r?\n’ | ForEach-Object {

$UninstallInfo = $_ -split ‘\r?\n’ | ForEach-Object {

$Line = $_ -split ‘=’

if ($Line.Count -eq 2) {

[PSCustomObject]@{

Key = $Line[0].Trim()

Value = $Line[1].Trim()

}

}

}

$DisplayName = $UninstallInfo | Where-Object { $_.Key -eq ‘”DisplayName”‘ }

$DisplayVersion = $UninstallInfo | Where-Object { $_.Key -eq ‘”DisplayVersion”‘ }

$Publisher = $UninstallInfo | Where-Object { $_.Key -eq ‘”Publisher”‘ }

if ($DisplayName -and $DisplayVersion -and $Publisher) {

($DisplayName.Value), ($DisplayVersion.Value), ($Publisher.Value) -join ‘;’

}

}

C:\edv\00_modern_workplace\software32.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update]

“DisplayName”=”Microsoft Edge Update”

“NoModify”=dword:00000001

“NoRepair”=dword:00000001

“DisplayVersion”=”1.3.173.55”

“Version”=”1.3.173.55”

Output:


Here is the version which get the information direct from the local machine:

# www.butsch.ch

# Version 2 direct access from Registry Hives

# V1.0, 03.09.2023, First Release

# This PS will retrieve all information he can find about installed Software 32/64BIT Hives and write the data into a file output.txt

# ———————————————————————————————————————————–

# Define the Registry paths for both 32-bit and 64-bit programs

$registryPaths = @(

“HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”,

“HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall”

)

# Initialize an empty array to store the results

$results = @()

# Iterate through the Registry paths

foreach ($path in $registryPaths) {

# Get all subkeys (uninstall entries) under the Registry path

$uninstallKeys = Get-ChildItem -Path $path | Where-Object { $_.PSChildName -match ‘^{[A-F0-9-]+}’ }

# Iterate through each uninstall entry

foreach ($key in $uninstallKeys) {

$properties = Get-ItemProperty -Path “$path\$($key.PSChildName)” -ErrorAction SilentlyContinue

if ($properties -ne $null) {

$entry = $properties.DisplayName

if ($properties.DisplayVersion) {

$entry += “;$($properties.DisplayVersion)”

}

if ($properties.Publisher) {

$entry += “;$($properties.Publisher)”

}

$results += $entry

}

}

}

# Output the results to a file

$results | Out-File -FilePath “output.txt”

# Display the results on the console (optional)

$results


 Category published:  Deployment Scripting   Click on the Category button to get more articles regarding that product.