0
votes

I've trying to write a brief Powershell script which goes through a list of servers and checks if there is a web-browser or web-browsers installed.

I can query a list of installed applications using the following command however this doesn't show if Internet Explorer is installed on the server.

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object {$_.DisplayName -like "*Internet Explore*"} | Select-Object -ExpandProperty DisplayName

Is there a better way to query a registery value for true/false if there is a browser installed?

Also is there a better way to get a list of installed browsers on Windows Server than using the "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall*". Is there an alternative registery location for web-browsers on Windows Server that can be queried?

1
internet explorer is built into windows so it wont show up in the registry key that you query...and yes registry query is the best way to determine installed apps - Kiran
Thanks Kiran. Are you aware of any Registery key that can give a true/false to any web-browsers being installed? - thal0k
I am not aware of any key tht would display a boolean but it is pretty easy to make your own...i will post it in the answer section.. - Kiran

1 Answers

0
votes
Function Test-RegValue
{
param([string]$RegKeyPath,[string]$Value)
    if(test-path $RegKeyPath)
    {
        (Get-ItemProperty $RegKeyPath).$Value -ne $null

    }
    else
    {
        $false
    }

}

Test-RegValue -RegKeyPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E3C7B5F-362C-440E-9895-726083B802E1}"  -Value displayname

If the root key exists then we check if the property "displayname" has a value. On my computer this 8E3C7B5F-362C-440E-9895-726083B802E1 reg key correponds to "node.js"

so just make a list of the reg key id's for various browsers and pass them as param values to regkeypath