Introduction
System administrators and IT professionals often need to inventory installed software across their systems. This PowerShell script provides a quick and efficient way to generate a list of installed applications and their versions from the Windows registry.
The Script
<#
.SYNOPSIS
Retrieves a list of installed software from Windows Registry
.DESCRIPTION
Generates a detailed inventory of installed applications with their names and versions,
including both 32-bit and 64-bit applications
#>
Write-Host "`nGathering installed software information..." -ForegroundColor Cyan
# Get software from 32-bit registry location
Write-Host "Checking 32-bit applications..." -ForegroundColor Yellow
$32BitApps = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Where-Object DisplayName -ne $null |
Select-Object DisplayName, DisplayVersion |
Sort-Object DisplayName
# Get software from 64-bit registry location
Write-Host "Checking 64-bit applications..." -ForegroundColor Yellow
$64BitApps = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
Where-Object DisplayName -ne $null |
Select-Object DisplayName, DisplayVersion |
Sort-Object DisplayName
# Combine and display results
$AllApps = @($32BitApps) + @($64BitApps) | Sort-Object DisplayName -Unique
Write-Host "`nInstalled Software Inventory:" -ForegroundColor Green
Write-Host "------------------------" -ForegroundColor Green
foreach ($App in $AllApps) {
Write-Host "Name: " -NoNewline -ForegroundColor Cyan
Write-Host $App.DisplayName -NoNewline
Write-Host " | Version: " -NoNewline -ForegroundColor Cyan
Write-Host $App.DisplayVersion
}
Write-Host "`nTotal Applications Found: " -NoNewline -ForegroundColor Green
Write-Host $AllApps.Count -ForegroundColor Yellow
Write-Host "------------------------`n" -ForegroundColor Green
How It Works
This enhanced script performs a comprehensive software inventory by:
- Registry Access: Queries both 32-bit and 64-bit registry locations for installed software
- Data Filtering: Removes empty entries and sorts applications alphabetically
- Unified Output: Combines results from both registry locations
- Color-Coded Display: Uses different colors for better readability
- Summary Information: Provides a total count of discovered applications
Conclusion
This script is an essential tool for system administrators who need to audit software installations across their systems. It provides a quick and efficient way to generate software inventories, which can be useful for compliance checking, license management, or system documentation purposes.
Remember to run this script with administrative privileges to ensure access to all registry locations.