Tuesday, February 13, 2024

#107: Find list of all the applications installed in your system using Powershell

Below code can be quick and easy to get the list. 


# Get all installed applications
$installedApplications = Get-WmiObject -Class Win32_Product

# Output information about each installed application
foreach ($app in $installedApplications) {
    Write-Output "Name: $($app.Name)"
    Write-Output "Version: $($app.Version)"
    Write-Output "Vendor: $($app.Vendor)"
    Write-Output "InstallDate: $($app.InstallDate)"
    Write-Output "-----------------------------"
}

As you know, use $app object and get more and more details that written above. 

If this one does not work for some reason, you can try another one: 
Somehow it runs faster for me than the above one.

# Define the registry path where installed applications are stored
$registryPath = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"

# Get all installed applications from the registry
$installedApplications = Get-ItemProperty -Path $registryPath |
    Where-Object { $_.DisplayName -and $_.DisplayName -ne "" } |
    Select-Object DisplayName, DisplayVersion, Publisher, InstallDate

# Output information about each installed application
foreach ($app in $installedApplications) {
    Write-Output "Name: $($app.DisplayName)"
    Write-Output "Version: $($app.DisplayVersion)"
    Write-Output "Publisher: $($app.Publisher)"
    Write-Output "InstallDate: $($app.InstallDate)"
    Write-Output "-----------------------------"
}


Hope you liked this post.

Thanks!!

No comments:

Post a Comment

#112: How to handle xml document in Powershell?

 In PowerShell, you can handle XML data using various cmdlets and methods provided by the .NET Framework. Here's a basic guide on how to...