mirror of
https://github.com/actions/runner-images.git
synced 2025-12-24 10:28:00 +08:00
changed connection to SQL due to some mistakes
This commit is contained in:
@@ -22,10 +22,10 @@ function Test-SqlConnection {
|
||||
$ErrorActionPreference = 'Stop'
|
||||
try {
|
||||
$connectionString = 'Server={0};Integrated Security={1};User ID={2};Password={3}' -f $ServerName,$IntegratedSecurity,$UserName,$Password
|
||||
Write-Host -Object "Trying to connect to SQL Express instance: $ServerName"
|
||||
Write-Host $connectionString
|
||||
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $connectionString
|
||||
$sqlConnection.Open()
|
||||
Write-Host -Object "Connection to database: {0} was successful. Version of SQL Express is: {1}" -f $sqlConnection.Database,$sqlConnection.ServerVersion
|
||||
Write-Host -Object "Connection to SQL Express was successful."
|
||||
return $sqlConnection.ServerVersion
|
||||
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user