Skip to content

Commit ed47076

Browse files
author
devizer
committed
Setup-SQL-Server-in-Container.ps1: optional ENV:SQLSERVERS_INSTALL_TO
1 parent 02a6d4d commit ed47076

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

SQL-Server-in-Windows-Container/Setup-SQL-Server-in-Container.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,17 @@ Say "Starting vcredist2008_x86.exe ..."
7676
$collation = If ("$ENV:SQL" -match "2019" -or "$ENV:SQL" -match "2022" -or "$ENV:SQL" -match "2025") { "Latin1_General_100_CI_AS_SC_UTF8" } Else { "SQL_Latin1_General_CP1_CI_AS" };
7777
Say "SQL Setup COLLATION = '$collation'"
7878

79-
If ("$ENV:SQL" -match 2005) { Setup-SqlServers "$ENV:SQL" }
80-
ElseIf ("$ENV:SQL" -match 2008) { Setup-SqlServers "$ENV:SQL" "Collation=$collation" /SkipRules=PerfMonCounterNotCorruptedCheck }
79+
$installTo = "$($ENV:SQLSERVERS_INSTALL_TO)"
80+
if (-not $installTo) { $installTo = "C:\SQL" }
81+
Write-Host "Target SQL Server Install Folder: [$installTo]"
82+
83+
If ("$ENV:SQL" -match 2005) { Setup-SqlServers "$ENV:SQL" "InstallTo=$installTo" }
84+
ElseIf ("$ENV:SQL" -match 2008) { Setup-SqlServers "$ENV:SQL" "InstallTo=$installTo" "Collation=$collation" /SkipRules=PerfMonCounterNotCorruptedCheck }
8185
# ElseIf ("$ENV:SQL" -match 2012) { Setup-SqlServers "$ENV:SQL" "/SkipRules=PerfMonCounterNotCorruptedCheck FacetPowerShellCheck RebootRequiredCheck" }
8286
# ElseIf ("$ENV:SQL" -match 2012) { Setup-SqlServers "$ENV:SQL" "/SkipRules=AllRules" }
8387
# !!!!!!!!!!!!!!!!!!!!!!! /BROWSERSVCSTARTUPTYPE=Disabled
84-
ElseIf ("$ENV:SQL" -match 2012) { Setup-SqlServers "$ENV:SQL" "Collation=$collation" "/BROWSERSVCSTARTUPTYPE=Disabled" "/SkipRules=RebootRequiredCheck PerfMonCounterNotCorruptedCheck FacetPowerShellCheck AclPermissionsFacet Cluster_VerifyForErrors Cluster_IsOnlineIfServerIsClustered BlockMixedArchitectureInstall VSSShellInstalledFacet X86SupportedOn64BitCheck Wow64PlatformCheck NoGuidAllAppsCheck" }
85-
Else { Setup-SqlServers "$ENV:SQL" "Collation=$collation" /SkipRules=PerfMonCounterCheck }
88+
ElseIf ("$ENV:SQL" -match 2012) { Setup-SqlServers "$ENV:SQL" "InstallTo=$installTo" "Collation=$collation" "/BROWSERSVCSTARTUPTYPE=Disabled" "/SkipRules=RebootRequiredCheck PerfMonCounterNotCorruptedCheck FacetPowerShellCheck AclPermissionsFacet Cluster_VerifyForErrors Cluster_IsOnlineIfServerIsClustered BlockMixedArchitectureInstall VSSShellInstalledFacet X86SupportedOn64BitCheck Wow64PlatformCheck NoGuidAllAppsCheck" }
89+
Else { Setup-SqlServers "$ENV:SQL" "InstallTo=$installTo" "Collation=$collation" /SkipRules=PerfMonCounterCheck }
8690

8791

8892
# SkipRules="RebootRequiredCheck PerfMonCounterNotCorruptedCheck FacetPowerShellCheck AclPermissionsFacet Cluster_VerifyForErrors Cluster_IsOnlineIfServerIsClustered BlockMixedArchitectureInstall"

0 commit comments

Comments
 (0)