mirror of
https://github.com/actions/runner-images.git
synced 2025-12-23 09:58:08 +08:00
15 lines
335 B
PowerShell
15 lines
335 B
PowerShell
$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
|
|
} |