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

Welcome Forums General PowerShell Q&A Powershell Function (Method) to check if some software is installed on Windows?

Viewing 4 reply threads
  • Author
    Posts
    • #220425
      Participant
      Topics: 6
      Replies: 5
      Points: 82
      Rank: Member

      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!!!

    • #220431
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      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.

    • #220452
      Participant
      Topics: 6
      Replies: 5
      Points: 82
      Rank: Member

      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

       

    • #220455
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      … I am struggling to find common way for all cases.

      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. 😉

    • #220470
      js
      Participant
      Topics: 29
      Replies: 809
      Points: 2,428
      Helping Hand
      Rank: Community Hero
      get-package softwarename
Viewing 4 reply threads
  • You must be logged in to reply to this topic.