Skip to content

Instantly share code, notes, and snippets.

@gcch
Created April 13, 2022 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcch/26eacfe4b3b1cafd73fa5236435a2209 to your computer and use it in GitHub Desktop.
Save gcch/26eacfe4b3b1cafd73fa5236435a2209 to your computer and use it in GitHub Desktop.
#
# Get-InstalledWindowsApps.ps1
#
# Copyright (c) 2022 tag.
#
$Hostname = $Env:COMPUTERNAME
$Target = "D:\Directory\${Hostname}.csv"
$AppList = (Get-ChildItem -Path ("HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall", "HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall") | % { Get-ItemProperty $_.PsPath } | ? { $_.DisplayName -notlike "" })
$AppList | Add-Member -MemberType NoteProperty -Name "ComputerName" -Value $Hostname
$AppList | Select-Object ComputerName, DisplayName, DisplayVersion, Publisher, InstallDate, InstallLocation | Sort-Object DisplayName -Unique | Export-Csv -Path $Target -Encoding Default -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment