From 33fd9bde2ea2ab0311a27f0d2a31d374190ea37e Mon Sep 17 00:00:00 2001 From: "Dariy.Nurgaleev" Date: Fri, 20 Mar 2020 00:28:25 +0700 Subject: [PATCH] added some unneccesary things --- images/win/scripts/Installers/Install-SQLExpress.ps1 | 2 -- images/win/scripts/Installers/Validate-SQLExpress.ps1 | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/win/scripts/Installers/Install-SQLExpress.ps1 b/images/win/scripts/Installers/Install-SQLExpress.ps1 index 693c9303f..016dcd7cb 100644 --- a/images/win/scripts/Installers/Install-SQLExpress.ps1 +++ b/images/win/scripts/Installers/Install-SQLExpress.ps1 @@ -61,9 +61,7 @@ function Start-Installer { $installerUrl = "https://go.microsoft.com/fwlink/?linkid=866658" $downloadPath = "${env:Temp}" $setupPath = Join-Path $downloadPath "SQLEXPR_x64_ENU" -#Set default location for installation process Set-Location -Path $downloadPath -#Download installer for SQL Express and return path to it $installerPath = Start-DownloadWithRetry -Url "https://go.microsoft.com/fwlink/?linkid=866658" -Name SQL2019-SSEI-Expr.exe Download-FullSQLPackage -InstallerPath $installerPath Unpack-SQLInstaller -InstallPath "$setupPath.exe" diff --git a/images/win/scripts/Installers/Validate-SQLExpress.ps1 b/images/win/scripts/Installers/Validate-SQLExpress.ps1 index 106a5b7dc..ddb4ca3fd 100644 --- a/images/win/scripts/Installers/Validate-SQLExpress.ps1 +++ b/images/win/scripts/Installers/Validate-SQLExpress.ps1 @@ -27,9 +27,11 @@ function Test-SqlConnection { $sqlConnection.Open() Write-Host -Object "Connection to database: {0} was successful. Version of SQL Express is: {1}" -f $sqlConnection.Database,$sqlConnection.ServerVersion return $sqlConnection.ServerVersion + } catch { Write-Host -Object "Connection to SQL Express cannot be established." exit 1 + } finally { ## Close the connection when we're done $sqlConnection.Close()