Script to find an application version less than the current version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ10-19-2023 09:10 AM
Hello all, reposting a question and the script from a conversation in our JumpCloud Slack Lounge:
Question from @namlam: "Hello All, do you know a powershell command that can find an application version less than the current version. For example, how to find out any system that has Chrome version below 140.00"
Response from Josh C.: "Quick and dirty, writes to output any windows device with chrome version below 117.0.5938.150. Update the Target Version variable on line 8 for the version you want to be your cutoff.
It's not fast, but it works. This is run from your machine in powershell btw, it will prompt you for your api key and org ID and then run against your org's Database."
$allSystems = Get-JcSdkSystem
foreach ($system in $allSystems)
{
# Check if Windows machine
if ($system.OS -eq 'Windows')
{
#Set Target Version
$TargetVersion= [System.Version]"117.0.5938.150"
#Get list of all installed programs
$programs = Get-JCSystemInsights -Table Program -SystemId $system.Id
if ($programs.name -contains "Google Chrome")
{
ForEach ($program in $Programs)
{
if(($Program.name -like "Google Chrome" ) -and $Program.Version -lt $TargetVersion)
{
Write-Host $system.DisplayName
}
}
}
}
}
Thank you Nam and Josh for your contributions to the JumpCloud Community ๐
- Labels:
-
PowerShell
![](/skins/images/C210B62239BAF37B0AB0FAEB086BB5F1/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/C210B62239BAF37B0AB0FAEB086BB5F1/responsive_peak/images/icon_anonymous_message.png)