mirror of
https://github.com/actions/runner-images.git
synced 2026-01-06 10:09:20 +08:00
added SQL Express install step
This commit is contained in:
15
images/win/scripts/Installers/Validate-SQLExpress.ps1
Normal file
15
images/win/scripts/Installers/Validate-SQLExpress.ps1
Normal file
@@ -0,0 +1,15 @@
|
||||
$sqlConn = New-Object System.Data.SqlClient.SqlConnection
|
||||
$sqlConn.ConnectionString = "Server=$env:computername\SQL2019;Integrated Security=false;User ID=sa; Password=P@ssword!!"
|
||||
$sqlConn.Open()
|
||||
$str1=""
|
||||
$sqlConn.State
|
||||
IF (Compare-Object $sqlConn.State $str1)
|
||||
{
|
||||
Write-Host "Failed attempt"
|
||||
exit 1
|
||||
}
|
||||
ELSE
|
||||
{
|
||||
Write-Host "Success"
|
||||
exit 0
|
||||
}
|
||||
Reference in New Issue
Block a user