Powershell Script to check if SQL is Installed

Posted on

Here we go, short but sweet. I had to come up with this today when working with a SQL Server compliance item in SCCM 2012 using a script detection method. I’ve added the else back in, but you can modify however you need.

if (Test-Path “HKLM:\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL”) {
write-host “True”
} Else {
write-host “False”
}

 

I hope I’ve made your day, at least a little bit easier!

2 thoughts on “Powershell Script to check if SQL is Installed

    Petr said:
    May 22, 2017 at 12:14 am

    Thanks!

    jdashn said:
    February 19, 2018 at 10:14 am

    This was helpful! thanks!

Leave a Reply