mirror of
https://github.com/actions/runner-images.git
synced 2026-01-07 18:58:13 +08:00
added description for SQL Express scripts
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-SQLExpress.ps1
|
||||||
|
## Desc: Install SQL Express for Windows
|
||||||
|
## SQL Version: Microsoft SQL Express 2019 ( 15.00.2000 )
|
||||||
|
## InstanceName: SQL2019
|
||||||
|
## Username - sa
|
||||||
|
## Password - P@ssword!!
|
||||||
|
## Default path - C:\Program Files (x86)\Microsoft SQL Server
|
||||||
|
################################################################################
|
||||||
function Start-Task {
|
function Start-Task {
|
||||||
param(
|
param(
|
||||||
[String]$InstallPath,
|
[String]$InstallPath,
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Validate-SQLExpress.ps1
|
||||||
|
## Desc: Validate Microsoft SQL Express installation
|
||||||
|
################################################################################
|
||||||
function Test-SqlConnection {
|
function Test-SqlConnection {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -20,7 +24,7 @@ function Test-SqlConnection {
|
|||||||
Write-Host -Object "Trying to connect to SQL Express instance: $ServerName"
|
Write-Host -Object "Trying to connect to SQL Express instance: $ServerName"
|
||||||
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $connectionString
|
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $connectionString
|
||||||
$sqlConnection.Open()
|
$sqlConnection.Open()
|
||||||
Write-Host -Object "Connection to SQL Express was successful."
|
Write-Host -Object "Connection to database: {0} in in was successful. Version of SQL Express is: {1}" -f $sqlConnection.Database,$sqlConnection.ServerVersion
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host -Object "Connection to SQL Express cannot be established."
|
Write-Host -Object "Connection to SQL Express cannot be established."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user