Created
April 13, 2022 14:51
-
-
Save gcch/26eacfe4b3b1cafd73fa5236435a2209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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