For our enterprise clients, verifying the successful installation of the Wellnomics App post-deployment is a common requirement. To facilitate this, we've devised a straightforward PowerShell script. This script checks if the required version of the application is installed on your system and outputs '0' for a successful detection and '1' if the specified version is not found. This simple and efficient tool aids in confirming the correct deployment of Wellnomics App in your enterprise environment.
$appName = "Wellnomics" $version = "2.3.0.5739" # the version to check for # Check both HKLM and HKCU $registryPaths = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" # An array to store all matching keys $matchingKeys = @() foreach ($registryPath in $registryPaths) { $matchingKeys += Get-ChildItem -Path $registryPath -ErrorAction SilentlyContinue | Where-Object { (Get-ItemProperty -Path $_.PSPath).DisplayName -eq $appName -and (Get-ItemProperty -Path $_.PSPath).DisplayVersion -eq $version } } # If a matching key is found, the application with the specified version is installed, so output 0 if ($matchingKeys) { exit 0 } else { # If no matching key was found, the application or the specific version is not installed, so output 1 exit 1 }
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article