Skip to content

Commit 7cbcf56

Browse files
author
devizer
committed
Module: Brush up tests, 3rd
1 parent 8f9cd48 commit 7cbcf56

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

Install-SqlServer-Version-Management.ps1

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Param(
44
)
55

66
$ModuleName = 'SqlServer-Version-Management';
7-
$ModuleVersion = '2.1.156';
7+
$ModuleVersion = '2.1.165';
88
$ModuleFiles = @(
99
@{
1010
FileName = 'SqlServer-Version-Management\SqlServer-Version-Management.psd1';
@@ -15,7 +15,7 @@ $ModuleFiles = @(
1515
" ModuleToProcess = @('SqlServer-Version-Management.psm1')",
1616
"",
1717
" # Version below is automatically incremented on build",
18-
" ModuleVersion = `"2.1.156`"",
18+
" ModuleVersion = `"2.1.165`"",
1919
"",
2020
" GUID = 'dd03b53d-575a-4056-ae08-e6dfea3384ea'",
2121
"",
@@ -1830,7 +1830,6 @@ $ModuleFiles = @(
18301830
" `$cacheArgs = @();",
18311831
" `$cacheFolder = `"`$ENV:VS_SETUP_CACHE_FOLDER`"",
18321832
" if (`$cacheFolder) { `$cacheArgs = @(`"--path`", `"cache=```"`$cacheFolder```"`") }",
1833-
" `$installFolderArgs = if (`"`$ENV:VS_SETUP_INSTALL_FOLDER`") { @(`"--path`", `"install=```"`$(`$ENV:VS_SETUP_INSTALL_FOLDER)```"`") } Else { @() }",
18341833
" `$removeNonEnglish = @(`"cs-CZ de-DE es-ES fr-FR it-IT ja-JP ko-KR pl-PL pt-BR ru-RU tr-TR zh-CN zh-TW`".Split(`" `") | % { `"--removeProductLang `$_`" }) -join `" `"",
18351834
" `$addEnglish = `"--addProductLang en-US`"",
18361835
" # NET Core SDK: `"Microsoft.NetCore.Component.SDK`"",
@@ -1906,6 +1905,9 @@ $ModuleFiles = @(
19061905
" setx VS_SETUP_CACHE_FOLDER T:\VS-Cache",
19071906
" `$ENV:VS_SETUP_CACHE_FOLDER = `"T:\VS-Cache`"",
19081907
"",
1908+
" `$ENV:VS_SETUP_INSTALL_FOLDER = `"T:\Micorosft Visual Studio`"",
1909+
" setx VS_SETUP_INSTALL_FOLDER `"T:\Micorosft Visual Studio`"",
1910+
"",
19091911
" # Interactive Setup",
19101912
" Setup-VisualStudio `"2026 Enterprise`"",
19111913
"",
@@ -1928,7 +1930,14 @@ $ModuleFiles = @(
19281930
" if (`$arguments -and (`$arguments.Length -eq 1)) {",
19291931
" Write-Host `"Installing [`$vsid] as nickname = '`$nickname'`"",
19301932
" `$foundArgs = Build-VisualStudio-Setup-Arguments `$arguments[0] `$nickname;",
1931-
" if (`$foundArgs -and (`$foundArgs.Length -gt 0)) { `$arguments = `$foundArgs }",
1933+
" if (`$foundArgs -and (`$foundArgs.Length -gt 0)) { ",
1934+
" `$arguments = `$foundArgs",
1935+
" `$installFolder = `"`$ENV:VS_SETUP_INSTALL_FOLDER`"; ",
1936+
" if (`$installFolder) {",
1937+
" if (`$installFolder -match `"{VSID}`") { `$installFolder = `"`$installFolder`".Replace(`"{VSID}`", `"`$vsid`") } Else { `$installFolder = Combine-Path `$installFolder `"`$vsid`" }",
1938+
" `$arguments = @(@(`$arguments) + @(`"--path`", `"install=```"`$installFolder```"`") | ? { `$_ })",
1939+
" }",
1940+
" }",
19321941
" }",
19331942
"",
19341943
" `$isSetupRinning = Wait-For-VisualStudio-Setup-Is-Running -Timeout 1",
@@ -1938,7 +1947,8 @@ $ModuleFiles = @(
19381947
" }",
19391948
"",
19401949
" Write-Host `"```"`$exe```" `$arguments`" -ForegroundColor Yellow",
1941-
" if (`$arguments -and (`$arguments.Length -gt 0)) { `$__ = Start-Process `$exe -ArgumentList `$arguments } Else { `$__ = Start-Process `$exe }",
1950+
" # Write-Host `"`$(`$arguments -join `"``r``n`")`" -ForegroundColor Magenta",
1951+
" if (`$arguments -and (`$arguments.Length -gt 0)) { `$__ = Start-Process `$exe -ArgumentList @(`$arguments | ? { `$_ }) } Else { `$__ = Start-Process `$exe }",
19421952
" # wating for bootstrapper.exe forward control to setup.exe",
19431953
" return Wait-For-VisualStudio-Setup-Is-Running -Timeout (5*60*1000)",
19441954
"}",

SqlServer-Version-Management.ps1

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,6 @@ function Build-VisualStudio-Setup-Arguments([string] $type, [string] $nickname)
17311731
$cacheArgs = @();
17321732
$cacheFolder = "$ENV:VS_SETUP_CACHE_FOLDER"
17331733
if ($cacheFolder) { $cacheArgs = @("--path", "cache=`"$cacheFolder`"") }
1734-
$installFolderArgs = if ("$ENV:VS_SETUP_INSTALL_FOLDER") { @("--path", "install=`"$($ENV:VS_SETUP_INSTALL_FOLDER)`"") } Else { @() }
17351734
$removeNonEnglish = @("cs-CZ de-DE es-ES fr-FR it-IT ja-JP ko-KR pl-PL pt-BR ru-RU tr-TR zh-CN zh-TW".Split(" ") | % { "--removeProductLang $_" }) -join " "
17361735
$addEnglish = "--addProductLang en-US"
17371736
# NET Core SDK: "Microsoft.NetCore.Component.SDK"
@@ -1807,6 +1806,9 @@ function Setup-VisualStudio([string] $VSID, [string[]] $arguments) {
18071806
setx VS_SETUP_CACHE_FOLDER T:\VS-Cache
18081807
$ENV:VS_SETUP_CACHE_FOLDER = "T:\VS-Cache"
18091808
1809+
$ENV:VS_SETUP_INSTALL_FOLDER = "T:\Micorosft Visual Studio"
1810+
setx VS_SETUP_INSTALL_FOLDER "T:\Micorosft Visual Studio"
1811+
18101812
# Interactive Setup
18111813
Setup-VisualStudio "2026 Enterprise"
18121814
@@ -1829,7 +1831,14 @@ function Setup-VisualStudio([string] $VSID, [string[]] $arguments) {
18291831
if ($arguments -and ($arguments.Length -eq 1)) {
18301832
Write-Host "Installing [$vsid] as nickname = '$nickname'"
18311833
$foundArgs = Build-VisualStudio-Setup-Arguments $arguments[0] $nickname;
1832-
if ($foundArgs -and ($foundArgs.Length -gt 0)) { $arguments = $foundArgs }
1834+
if ($foundArgs -and ($foundArgs.Length -gt 0)) {
1835+
$arguments = $foundArgs
1836+
$installFolder = "$ENV:VS_SETUP_INSTALL_FOLDER";
1837+
if ($installFolder) {
1838+
if ($installFolder -match "{VSID}") { $installFolder = "$installFolder".Replace("{VSID}", "$vsid") } Else { $installFolder = Combine-Path $installFolder "$vsid" }
1839+
$arguments = @(@($arguments) + @("--path", "install=`"$installFolder`"") | ? { $_ })
1840+
}
1841+
}
18331842
}
18341843

18351844
$isSetupRinning = Wait-For-VisualStudio-Setup-Is-Running -Timeout 1
@@ -1839,7 +1848,8 @@ function Setup-VisualStudio([string] $VSID, [string[]] $arguments) {
18391848
}
18401849

18411850
Write-Host "`"$exe`" $arguments" -ForegroundColor Yellow
1842-
if ($arguments -and ($arguments.Length -gt 0)) { $__ = Start-Process $exe -ArgumentList $arguments } Else { $__ = Start-Process $exe }
1851+
# Write-Host "$($arguments -join "`r`n")" -ForegroundColor Magenta
1852+
if ($arguments -and ($arguments.Length -gt 0)) { $__ = Start-Process $exe -ArgumentList @($arguments | ? { $_ }) } Else { $__ = Start-Process $exe }
18431853
# wating for bootstrapper.exe forward control to setup.exe
18441854
return Wait-For-VisualStudio-Setup-Is-Running -Timeout (5*60*1000)
18451855
}

0 commit comments

Comments
 (0)