From 6b8ec803ad7352db49290b48f7c8c20cc51a583c Mon Sep 17 00:00:00 2001 From: "Dariy.Nurgaleev" Date: Tue, 17 Mar 2020 21:54:40 +0700 Subject: [PATCH] added messages --- images/win/scripts/Installers/Install-SQLExpress.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/images/win/scripts/Installers/Install-SQLExpress.ps1 b/images/win/scripts/Installers/Install-SQLExpress.ps1 index a732f86b7..113fe1e90 100644 --- a/images/win/scripts/Installers/Install-SQLExpress.ps1 +++ b/images/win/scripts/Installers/Install-SQLExpress.ps1 @@ -1,14 +1,15 @@ function Start-Task { param( [String]$InstallPath, - [String]$Arguments + [String]$Arguments, + [String]$SuccessMessage ) $process = Start-Process -FilePath $InstallPath -ArgumentList $Arguments -Wait -PassThru $exitCode = $process.ExitCode # Exit code -2067529716 is added since SQL Unpack procedure returns it on success. if ($exitCode -eq 0 -or -2067529716) { - Write-Host -Object "Success. Exit code: $exitCode." + Write-Host -Object "$SuccessMessage : ExitCode: $exitCode" } else { @@ -36,8 +37,8 @@ $installArgs = ("/Q", "/IACCEPTSQLSERVERLICENSETERMS", "/Action=Install", "/INST #Download installer for SQL Express Start-DownloadSQLExpress -InstallerUrl $installerUrl -InstallerPath $installerPath #Download full SQL Express package -Start-Task -InstallPath $installerPath -Arguments $downloadArgs +Start-Task -InstallPath $installerPath -Arguments $downloadArgs -SuccessMessage "Downloaded package from: $installerUrl . To path: $installerPath " #Unpack SQL Express Installer -Start-Task -InstallPath "$setupPath.exe" -Arguments $unpackArgs +Start-Task -InstallPath "$setupPath.exe" -Arguments $unpackArgs -SuccessMessage "Unpacked package to directory: $setupPath" #Start SQL Express installer silently -Start-Task -InstallPath "$setupPath/SETUP.exe" -Arguments $installArgs \ No newline at end of file +Start-Task -InstallPath "$setupPath/SETUP.exe" -Arguments $installArgs -SuccessMessage "SQL has been installed to directory: ${env:ProgramFiles}/Microsoft SQL Server" \ No newline at end of file