Reputation: 149
I wanted to know what version of software(say X software) installed in my system with PowerShell. In my case, I wanted to know what version of Service Fabric SDK installed in my system with PowerShell.
Upvotes: 1
Views: 23997
Reputation: 468
In our case, we needed to verify if MongoDB was installed on multiple servers, and if so, what version. We used a simple PowerShell command and pushed it out multiple servers via Ansible/AWX. Here's the command:
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object {$_.DisplayName -like "*MongoDB*"} | Select-Object DisplayName, DisplayVersion, InstallDate | Format-List;
Upvotes: 3
Reputation: 1205
This link highlight very well what the issues are with using the WMI approach and then outlines a solution for using the registry. The way he does the registry also allows for calling it against remote machines.
https://mcpmag.com/articles/2017/07/27/gathering-installed-software-using-powershell.aspx
Upvotes: 0
Reputation: 62492
You can use WMI to get information of an installed product. To do this filter by the Name
. For example, to get information of Word:
$product = gwmi win32_product -filter "Name LIKE '%Word%'"
You will then find the version information in the Version
property:
$product.Version
NOTE: The WMI lookups can be a bit slow, so be patient!
Upvotes: -1
Reputation: 980
if your process/software is run , use this command :
Get-Process -Name "xsoftware" | Format-list -Property ProductVersion
Upvotes: 2