I've written a script that retrieves the application name, publisher and version from the registry entries located in "HKLM:\Software\MMSOFT Design\PC Monitor\InstalledApplicationsSnapshot". How can I make sure the software versions listed in this location are updated to the latest version of the applications installed? Is there a way to force update these records? For example, I have a mismatch in a system that the PW web dashboard is reporting Citrix Files being at version 20.9.1.0 (which is correct as of the last 24 hours), and the local registry entry for this application under the PC Monitor\InstalledApplicationsSnapshot is still reporting the previous version 20.7.7.0.
$exportPath = "C:\temp\IT\"
$exportFile = $exportPath + "installedApplications.json"
$objArray = @()
$installedApplications = Get-ChildItem "HKLM:\Software\MMSOFT Design\PC Monitor\InstalledApplicationsSnapshot"
foreach($item in $installedApplications){
$obj = New-Object PSObject
$obj | Add-Member -MemberType NoteProperty -Name "Id" -Value $item.GetValue('Id')
$obj | Add-Member -MemberType NoteProperty -Name "Name" -Value $item.GetValue('Name')
$obj | Add-Member -MemberType NoteProperty -Name "Publisher" -Value $item.GetValue('Publisher')
$obj | Add-Member -MemberType NoteProperty -Name "Version" -Value $item.GetValue('Version')
$objArray += $obj
}
$objArray | Sort-Object -Property Publisher, Name | ConvertTo-Json | Out-File ( New-Item -Path $exportFile -Force)
$jsonOutput = Get-Content $exportFile | ConvertFrom-Json | Format-Table -Property Name, Publisher, Version -AutoSize
Write-Output $jsonOutput