CodeUnderflow CodeUnderflow - 1 year ago 117
PowerShell Question

Find out the current version and update of an installed application

I have some requirement where I have to find out the current version and update details of an installed application (highlighted):

enter image description here

And I have this PowerShell snippet for modification:


$ServiceInfo = Get-WmiObject win32_service -ComputerName $server -ExpandProperty Version | Where-Object {$_.Name -eq "VSTTAgent"}
if($ServiceInfo.State -eq "Running")
$userAccount = $ServiceInfo.DisplayName.ToString()
Write-Host ("VSTTAgent service is Running on $server and $userAccount ")

Answer Source

To get the product version, you can use the Get-Item cmdlet using the PathName property of your $ServiceInfo object:

$ServiceInfo.PathName.Trim('"') | Get-Item | select -expand VersionInfo | select ProductVersion
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download