From 770a4152fda1f82e62f50aa07ee6866b7ae40329 Mon Sep 17 00:00:00 2001 From: "Dariy.Nurgaleev" Date: Tue, 24 Mar 2020 16:12:52 +0700 Subject: [PATCH] added new variable to FullSQLPackage function --- images/win/scripts/Installers/Install-SQLExpress.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/images/win/scripts/Installers/Install-SQLExpress.ps1 b/images/win/scripts/Installers/Install-SQLExpress.ps1 index d93f82383..8e64c6212 100644 --- a/images/win/scripts/Installers/Install-SQLExpress.ps1 +++ b/images/win/scripts/Installers/Install-SQLExpress.ps1 @@ -7,14 +7,15 @@ Import-Module -Name ImageHelpers -Force; function Download-FullSQLPackage { param( [String]$InstallerPath, - [String]$Arguments = ("/MEDIAPATH=$InstallerPath", "/MEDIATYPE=Core","/Action=Download", "/QUIET") + [String]$DownloadPath, + [String]$Arguments = ("/MEDIAPATH=$DownloadPath", "/MEDIATYPE=Core","/Action=Download", "/QUIET") ) - Write-Host "Downloading full package to $InstallerPath..." + Write-Host "Downloading full package to $DownloadPath..." $process = Start-Process -FilePath $InstallerPath -ArgumentList $Arguments -Wait -PassThru $exitCode = $process.ExitCode if ($exitCode -eq 0) { - Write-Host -Object "Full SQL Express package has been successfully downloaded to $InstallerPath : ExitCode: $exitCode" + Write-Host -Object "Full SQL Express package has been successfully downloaded to $DownloadPath : ExitCode: $exitCode" } else { @@ -68,7 +69,7 @@ $setupPath = Join-Path $downloadPath "SQLEXPR_x64_ENU" md $downloadPath Set-Location -Path $downloadPath $installerPath = Start-DownloadWithRetry -Url "https://go.microsoft.com/fwlink/?linkid=866658" -DownloadPath $downloadPath -Name "SQL2019-SSEI-Expr.exe" -Download-FullSQLPackage -InstallerPath $installerPath +Download-FullSQLPackage -InstallerPath $installerPath -DownloadPath $downloadPath Unpack-SQLInstaller -InstallPath "$setupPath.exe" $resultPath = Join-Path $setupPath "SETUP.exe" Write-Host $resultPath