mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
12 lines
342 B
PowerShell
12 lines
342 B
PowerShell
|
|
|
|
# This script checks if SQL Server is installed on Windows
|
|
|
|
[bool] $SqlInstalled = $false
|
|
$regPath = 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server'
|
|
if (Test-Path $regPath) {
|
|
$inst = (get-itemproperty $regPath).InstalledInstances
|
|
$SqlInstalled = ($inst.Count -gt 0)
|
|
}
|
|
Write-Output $SqlInstalled
|