crescent moon above mountain

Windows Software Inventory PowerShell Script

Introduction

System administrators and IT professionals often need to inventory installed across their systems. This provides a quick and efficient way to generate a list of installed applications and their versions from the .

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 by:

  1. Registry Access: Queries both 32-bit and 64-bit registry locations for installed software
  2. Data Filtering: Removes empty entries and sorts applications alphabetically
  3. Unified Output: Combines results from both registry locations
  4. Color-Coded Display: Uses different colors for better readability
  5. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WordPress Cookie Plugin by Real Cookie Banner