Issues using Get-InstalledApplication to remove Zoom


I’ve been working on using PSADT, specifically the Get-InstalledApplication to look for Zoom on the computer and if the version is less than 5.17.0 uninstall it using CleanZoom.exe
I tested the script on a couple different computers and it works on some but not all. I’ve narrowed it down to the my comparison statement for version numbers and the comparison operators not being able to deal with versioning in the x.xx.xxxxx format. Here’s a sample of my code, I’m hoping you folks can help me figure out a good way to be able to get it to accept the version number format and properly execute my If statement.

$ZoomVersion = Get-InstalledApplication "Zoom" | select-Object DisplayVersion -expand DisplayVersion

        If ($ZoomVersion -lt 5.17){
            Execute-Process -Path 'CleanZoom.exe' -Parameters '/silent' -WindowStyle 'Hidden'

Thanks for any assistance you can offer!

The way you did it makes PS turn your $ZoomVersion variable into a variable of type [Double] (aka a floating point or decimal variable)

Decimal numbers can only have one period or dot. (e.g. 5.17)
Version numbers can have up to 3 periods or dots (e.g. and that will break your code.

Just add [Version] when you get the version from Get-InstalledApplication and PS will get the hint:

[Version]$ZoomVersion = Get-InstalledApplication "Zoom" | select-Object DisplayVersion -expand DisplayVersion

        If ($ZoomVersion -lt 5.17){
            Execute-Process -Path 'CleanZoom.exe' -Parameters '/silent' -WindowStyle 'Hidden'
1 Like

Thank you so much for this! Figures it was something simple as adding [Version]. My powershell scripting skills are novice at best so I struggled with this far longer than I care to admit. Thanks again!


Just a word of warning with Zoom and versions, Zoom have a habit of using commas rather than decimals, in their versions
Here’s an example of the executables in / below C:\Program Files\Zoom:

Get-ChildItem zoom*.exe -Recurse -Force -ErrorAction SilentlyContinue | Select-Object versioninfo -ExpandProperty versioninfo | Sort-Object ProductVersion,FileVersionRaw,Filename | Select-Object ProductVersion,ProductVersionRaw,FileVersion,FileVersionRaw,Filename | ft -auto


ProductVersion ProductVersionRaw FileVersion   FileVersionRaw FileName
-------------- ----------------- -----------   -------------- --------
5,17,11,34827     5,17,11,34827  C:\Program Files\Zoom\bin\Zoom_launcher.exe
5,17,11,34827     5,17,11,34827  C:\Program Files\Zoom\bin\Zoom.exe
5,17,11,34827     5,17,11,34827  C:\Program Files\Zoom\bin\ZoomDocConverter.exe
5,17,11,34827     5,17,11,34827  C:\Program Files\Zoom\bin\ZoomOutlookIMPlugin.exe
5,17,11,34827     5,17,11,34827  C:\Program Files\Zoom\bin\ZoomOutlookMAPI.exe
5,17,11,34827     5,17,11,34827  C:\Program Files\Zoom\bin\ZoomOutlookMAPI64.exe

so depending on whether you use the ‘raw’ versions or the ‘non-raw’ versions may mean you need to do a -replace ",","." on the version returned

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.