How to get a complete list of installed softwares on a Windows machine by Powershell

Today i searched a lot about how to get a complete list of installed software on the internet but when i try each of them some packages were not shown, for example i tried to get the packages in different ways but unfortunately each of them had different lack of information:

Get-ciminstance win32_product | Select-Object Name, Version,InstallDate,@{Name="Server";Expression={$env:computername}} | $env:userprofile\Desktop\installedPackages-$env:computername.csv -Delimiter ";"
Get-wmiobject win32_product | Select-Object Name, Version,InstallDate,@{Name="Server";Expression={$env:computername}} | $env:userprofile\Desktop\installedPackages-$env:computername.csv -Delimiter ";"

The get-package command provides complete package info but it does not show “Install Date” for the packages:

get-package |  Select-Object Name, Version,@{Name="Server";Expression={$env:computername}}  |Export-Csv -NoTypeInformation $env:userprofile\Desktop\installedPackages-$env:computername.csv -Delimiter ";"

But these 2 below command were better than the other because each of them shows half of packages with “Install Date”

(Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall | % {Get-ItemProperty $_.PsPath} | where {$_.Displayname -and ($_.Displayname -match ".*")} |sort Displayname | select DisplayName, DisplayVersion,InstallDate, @{Name="Server";Expression={$env:computername}})
(Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall | % {Get-ItemProperty $_.PsPath} | where {$_.Displayname -and ($_.Displayname -match ".*")} |sort Displayname | select DisplayName, DisplayVersion,InstallDate, @{Name="Server";Expression={$env:computername}})

But finally i decided to merge and export the result of the last two commands, so i have the complete list of installed application with date of installation:

$a = (Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall | % {Get-ItemProperty $_.PsPath} | where {$_.Displayname -and ($_.Displayname -match ".*")} |sort Displayname | select DisplayName, DisplayVersion,InstallDate, @{Name="Server";Expression={$env:computername}})

$b = (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |Where-Object displayname -ne $null| Select-Object DisplayName, DisplayVersion,InstallDate,@{Name="Server";Expression={$env:computername}}|select DisplayName, DisplayVersion,InstallDate, @{Name="Server";Expression={$env:computername}})

$result = $a + $b
$result | select DisplayName, DisplayVersion,InstallDate, @{Name="Server";Expression={$env:computername}} |  Export-Csv -NoTypeInformation $env:userprofile\Desktop\installedSoftwarO-$env:computername.csv -Delimiter ";"


Leave a Reply

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

17 + = 27