Realized I gave you a query that would only display correctly within PowerShell. Better off doing something like -
Get-WmiObject -Query "SELECT * FROM Win32_InstalledStoreProgram" | select-object name,version
If you wanted to take it a step further, this is the only way I can currently think of to get this information in to Lansweeper, and it's still not perfect. The below will query the WMI location, and proceed to add the values to the registry at $RegLocation. You'd then have to set up Lansweeper scanning to scan for the registry entries you are creating. The downside is that you can't just tell Lansweeper to scan $RegLocation. You have to know the name of the key(s) you are looking for and add them in one by one. This is fine if you dump everything to some sort of master list and keep up on it, but a pain because you are in a situation where you have to know what you are looking for before you start looking.
##Variables - Choose your registry location. I just based it off of the wmi name.
##Setting IgnoreMS to 1 will ignore entries that start "Microsoft."
$RegLocation = 'HKLM:\SOFTWARE\Microsoft\Win32_InstalledStoreProgram'
$ignoreMS = 0
##Query
IF ( $ignoreMS -eq 1 ) {
$string = Get-WmiObject -Query "SELECT * FROM Win32_InstalledStoreProgram WHERE not NAME like 'Microsoft.%'" | select-object name,version
} ELSE {
$string = Get-WmiObject -Query "SELECT * FROM Win32_InstalledStoreProgram" | select-object name,version
}
##Cleanup (If you don't run this on some type of schedule, you'll just have static data)
IF (Test-Path $RegLocation) {
Remove-Item $RegLocation
}
##Add to registry
IF (!(Test-Path $RegLocation)) {
New-Item -Path $RegLocation
}
$string | ForEach-Object {
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Win32_InstalledStoreProgram -Name $_.name -Value $_.version -PropertyType "String"
}