PowerShell: List Installed Software on Local Computer in .CSV File

I had to collect the installed software from few computers and i used Belarc Advisor. The fun came when i started to consolidate the data :-)

To make my future life easier, I wrote a PowerShell script that exports a list of the installed programs into .CSV file.

Here it is:


$computerName = Get-WMIObject Win32_ComputerSystem | Select-Object -ExpandProperty name;

$outputFile = "G:\$computerName.csv";
if (Test-Path $outputFile) { Remove-Item $outputFile; }
Add-Content $outputFile "DisplayName¤DisplayVersion¤Publisher¤InstallDate";

$applications = Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*";

foreach ($application in $applications)
    $displayName = $application.DisplayName;
    $displayVersion = $application.DisplayVersion;
    $publisher = $application.Publisher;
    $installDate = $application.InstallDate;

    if ($displayName -ne $null -or $displayVersion -ne $null -or $publisher -ne $null -or $installDate -ne $null)
        Add-Content $outputFile "$displayName¤$displayVersion¤$publisher¤$installDate";

As usual i use ASCII 164 as delimiter.

Keep it simple :-)

About Peter Lalovsky

I am Microsoft SQL Server certified professional, creating with T-SQL, SSRS, SSIS, ASP.NET/C#, Azure, Python, PowerShell and more on a daily basis since year 2006. In 2016 i wrote a book for beginner and intermediate T-SQL programmers which you can download here. This blog is something like my personal programming documentation. When i am not in front of a computer, i am around my paper car – Trabant 601.

Leave a comment

Your email address will not be published.