I’m trying to write a script to uninstall the current version of zoom of my computer and install the new version using power shell . The install work fine but the uninstall is a different story ! Could someone look at it and give me some ideas ?
Before we proceed … please go back, edit your question once again and fix the formatting of your ocde.
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
( !! Sometimes the preformatted text button hides behind the settings gear symbol. )
We usually try to avoid assisting with those as the first port of call should be your teacher, tutor or supervisor.
Regardless of that here are some general tips or comments on your code:
What exactly does that mean? Doesn’t it work? Did you get errors? If “yes” you should share them here along with your code (formatted as code as well please.)
And BTW: Please stop adding spaces in front of punctuation marks.
How did you install Zoom? Is it a user installation? Do you want to uninstall the version from the currently logged on user?
Thanks for the tip on how to edit the format of the code. Lets say currently the user has Zoom installed but its an older version and I want the powershell to uninsnstall the curent version and install the latest. The error that i’m getting is that “Zoom is not installed on this machine.” . I think I’m mesing up the path somehow!
I chose this as a final project because I thought it would be simple, but I had more issues with this than any other project I worked on so far. Unfortunately asking as teacher or tutor is out of an option!
Sorry if that sounds picky, but do you run this code as the user who installed zoom?
If that’s the case you should (re-)read the blog post about not to use Win32_Product WMI class I linked above to learn how to determine installed products and their uninstallstring.
If you want to uninstall a Zoom user installation from another profile you will get issues.
Is that the error you’re actually creating yourself with your Write-Host command? Do you actually get errors?
Yes, I run the code as the user that installed zoom and no unfortunately I haven’t had time to read the post you posted above . Also I don’t know another way to determine the installed zoom . I apologize but I’m just trying to learn and I don’t know much about PowerShell. I’m taking the class to get a better understanding.
It’s not hat much … it does not take that long to read … … and it has the explanation why you should not use the WMI class Win32_Product anymore and how you get the information with a better approach. We cannot read or learn for you. You will have to do that by yourself.