Powershell Function (Method) to check if some software is installed on Windows?

Hi,

I have one software which consists of several applications which need to be installed on Windows. Its installation is within the C:/Program Files/ApplicationName/…

Some of those applications are run as service - some are not, for some of them exist configuration within the Registry but for some of them not. Is there maybe some native function, operation, method in PowerShell that can check somehow if specific application is installed on Windows or not? Or how to achieve this? What will be the best way?

The main purpose is that because I run 2 scripts using the PowerShell for those applications: installation and upgrade occasionally. If application does not exist then run installation script with all required parameters, if it exists then run Upgrade script with different arguments.

Thanks in advance!!!

Did you at least try to search for it? Something like this has been asked a thousand times even here on Powershell.org and you will find more than enough when you use your favorite search engine. There is no magical single cmdlet you can run. If you have a specific application not registering properly in Windows you’ll need to figure out how to determine if it’s properly installed or not.

Hi Olaf,

I found this article which describes process.

https://devblogs.microsoft.com/scripting/use-powershell-to-find-installed-software/

Is this the preferred way?

I need to write PowerShell script to achieve this but, as I mentioned I am struggling to find common way for all cases. That is why I asked if maybe PowerShell has native, and some out-of-the box command which can be used that covers applications that are registered as services, in registries and which are not in both of these.

Thanks,

Regards

 

That just does not exist. You have to figure that out for the particular software you are dealing with. If it’s a service you have to check this particular service. If it’s a copied executable you have to chekc this particular exe at the place where it belongs. There is no magic involved. It’s pure and simple hard work … for you. :wink:

get-package softwarename