Skip to content

Commit 9176678

Browse files
author
devizer
committed
Module: Brush up tests, 7th
1 parent 9a77c33 commit 9176678

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

Install-SqlServer-Version-Management.ps1

Lines changed: 7 additions & 4 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.168';
7+
$ModuleVersion = '2.1.169';
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.168`"",
18+
" ModuleVersion = `"2.1.169`"",
1919
"",
2020
" GUID = 'dd03b53d-575a-4056-ae08-e6dfea3384ea'",
2121
"",
@@ -1957,7 +1957,7 @@ $ModuleFiles = @(
19571957
" @(Get-Speedy-Software-Product-List | ? { `$_.Vendor -match `"Microsoft`" -and `$_.Name -like `"Visual*`" -and `$_.Name -match `"Studio`" } | Select-Object -Property Name, Version)",
19581958
"}",
19591959
"",
1960-
"function Test-Setup-VisualStudio([string] `$kind = `"Basic Components`" <# or Mini #>) {",
1960+
"function Test-Setup-VisualStudio([string] `$kind = `"Basic Components`" <# or Mini #>, [switch] `$nocache) {",
19611961
" # Set-ExecutionPolicy RemoteSigned; Install-Module SqlServer-Version-Management -Force -AllowClobber; if (Test-Path T:\) { setx VS_SETUP_CACHE_FOLDER T:\VS-Cache; `$ENV:VS_SETUP_CACHE_FOLDER = `"T:\VS-Cache`" }",
19621962
" # @(`"`$ENV:SYSTEMDRIVE\Program Files\Microsoft Visual Studio`", `"`$ENV:SYSTEMDRIVE\Program Files (x86)\Microsoft Visual Studio`") | % { New-Item -Path `"`$_`" -ItemType Directory -Force; & `"compact.exe`" /c /s:`"`$_`"; }",
19631963
" `$vsidList = @(`$VisualStudio_Setup_Metadata.Keys | % { `"`$_`" } | Sort-Object -Descending)",
@@ -1970,7 +1970,10 @@ $ModuleFiles = @(
19701970
" `$setupAction = {",
19711971
" Say `"EDITION: `$_`"; ",
19721972
" `$vsid = `$_",
1973-
" Setup-VisualStudio `$vsid `$kind",
1973+
" `$nickname = `$VisualStudio_Setup_Metadata[`"`$VSID`"][`"Nickname`"]",
1974+
" `$commandLineArgs = Build-VisualStudio-Setup-Arguments `$kind `$nickname",
1975+
" if (`$nocache) { `$commandLineArgs = @(`$commandLineArgs) + `"--nocache`"}",
1976+
" Setup-VisualStudio `$vsid `$commandLineArgs",
19741977
" `$okStarted = Wait-For-VisualStudio-Setup-Is-Running -Timeout (5*60*1000)",
19751978
" Write-Host `"Setup STARTED Success? `$okStarted`"",
19761979
" `$okCompleted = Wait-For-VisualStudio-Setup-Completed -Timeout (7200*1000)",

SqlServer-Version-Management.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ function Find-VisualStudio-Installed-Products() {
18581858
@(Get-Speedy-Software-Product-List | ? { $_.Vendor -match "Microsoft" -and $_.Name -like "Visual*" -and $_.Name -match "Studio" } | Select-Object -Property Name, Version)
18591859
}
18601860

1861-
function Test-Setup-VisualStudio([string] $kind = "Basic Components" <# or Mini #>) {
1861+
function Test-Setup-VisualStudio([string] $kind = "Basic Components" <# or Mini #>, [switch] $nocache) {
18621862
# Set-ExecutionPolicy RemoteSigned; Install-Module SqlServer-Version-Management -Force -AllowClobber; if (Test-Path T:\) { setx VS_SETUP_CACHE_FOLDER T:\VS-Cache; $ENV:VS_SETUP_CACHE_FOLDER = "T:\VS-Cache" }
18631863
# @("$ENV:SYSTEMDRIVE\Program Files\Microsoft Visual Studio", "$ENV:SYSTEMDRIVE\Program Files (x86)\Microsoft Visual Studio") | % { New-Item -Path "$_" -ItemType Directory -Force; & "compact.exe" /c /s:"$_"; }
18641864
$vsidList = @($VisualStudio_Setup_Metadata.Keys | % { "$_" } | Sort-Object -Descending)
@@ -1871,7 +1871,10 @@ function Test-Setup-VisualStudio([string] $kind = "Basic Components" <# or Mini
18711871
$setupAction = {
18721872
Say "EDITION: $_";
18731873
$vsid = $_
1874-
Setup-VisualStudio $vsid $kind
1874+
$nickname = $VisualStudio_Setup_Metadata["$VSID"]["Nickname"]
1875+
$commandLineArgs = Build-VisualStudio-Setup-Arguments $kind $nickname
1876+
if ($nocache) { $commandLineArgs = @($commandLineArgs) + "--nocache"}
1877+
Setup-VisualStudio $vsid $commandLineArgs
18751878
$okStarted = Wait-For-VisualStudio-Setup-Is-Running -Timeout (5*60*1000)
18761879
Write-Host "Setup STARTED Success? $okStarted"
18771880
$okCompleted = Wait-For-VisualStudio-Setup-Completed -Timeout (7200*1000)

0 commit comments

Comments
 (0)