small changes for scripts.

This commit is contained in:
Dariy.Nurgaleev
2020-03-24 17:35:11 +07:00
parent 739bbe26b5
commit dd931593e8
2 changed files with 5 additions and 2 deletions

View File

@@ -166,9 +166,9 @@ function Start-DownloadWithRetry
param (
[Parameter(Mandatory)]
[string] $Url,
[string] $DownloadPath = "${env:Temp}",
[Parameter(Mandatory)]
[string] $Name,
[string] $DownloadPath = "${env:Temp}",
[int] $retries = 20
)
$FilePath = Join-Path $DownloadPath $Name

View File

@@ -6,6 +6,7 @@ Import-Module -Name ImageHelpers -Force;
function Download-FullSQLPackage {
param(
[Parameter(Mandatory)]
[String]$InstallerPath,
[String]$DownloadPath,
[String]$Arguments = ("/MEDIAPATH=$DownloadPath", "/MEDIATYPE=Core","/Action=Download", "/QUIET")
@@ -26,6 +27,7 @@ function Download-FullSQLPackage {
function Unpack-SQLInstaller {
param(
[Parameter(Mandatory)]
[String]$InstallPath,
[String]$Arguments = ("/Q", "/IACCEPTSQLSERVERLICENSETERMS")
)
@@ -46,6 +48,7 @@ function Unpack-SQLInstaller {
function Start-Installer {
param(
[Parameter(Mandatory)]
[String]$InstallerPath,
[String]$Arguments = ("/Q", "/IACCEPTSQLSERVERLICENSETERMS", "/Action=Install", "/INSTANCEID=SQL2019", "/INSTANCENAME=SQL2019", "/SECURITYMODE=SQL", "/SAPWD=P@ssword!!", "/TCPENABLED=1")
)
@@ -69,7 +72,7 @@ $setupPath = Join-Path $downloadPath "SQLEXPR_x64_ENU"
#Create directory for temporary files
md $downloadPath
Set-Location -Path $downloadPath
$installerPath = Start-DownloadWithRetry -Url "https://go.microsoft.com/fwlink/?linkid=866658" -DownloadPath $downloadPath -Name "SQL2019-SSEI-Expr.exe"
$installerPath = Start-DownloadWithRetry -Url $installerUrl -DownloadPath $downloadPath -Name "SQL2019-SSEI-Expr.exe"
Download-FullSQLPackage -InstallerPath $installerPath -DownloadPath $downloadPath
Unpack-SQLInstaller -InstallPath "$setupPath.exe"
$resultPath = Join-Path $setupPath "SETUP.exe"