33 [string []]$Components ,
44 [bool ]$ForceEncryption ,
55 [string ]$SaPassword ,
6- [ValidateSet (" 2019" , " 2022" )]
6+ [ValidateSet (" 2019" , " 2022" , " 2025 " )]
77 [string ]$Version
88)
99
@@ -74,10 +74,13 @@ forceencryption = 1
7474
7575 switch ($Version ) {
7676 " 2019" {
77- $Tag = " CU30 -ubuntu-20.04"
77+ $Tag = " CU32-GDR3 -ubuntu-20.04"
7878 }
7979 " 2022" {
80- $Tag = " CU17-ubuntu-22.04"
80+ $Tag = " CU21-ubuntu-22.04"
81+ }
82+ " 2025" {
83+ $Tag = " RC1-ubuntu-24.04"
8184 }
8285 }
8386
@@ -87,23 +90,28 @@ forceencryption = 1
8790 }
8891
8992 if ($IsWindows ) {
90- Write-Output " Downloading and installing SQL Server"
91- New-Item - ItemType Directory - Path " C:\Downloads"
93+ Write-Output " Installing winget using chocolatey"
94+ & choco install - y winget
95+
96+ ls C:\ProgramData\chocolatey\lib\winget
9297
98+ Write-Output " Installing SQL Server Express with winget"
9399 switch ($Version ) {
94100 " 2019" {
95- $DownloadUrl = " https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SQLEXPR_x64_ENU.exe "
101+ $WingetId = " Microsoft.SQLServer.2019.Express "
96102 $MajorVersion = 15
97103 }
98104 " 2022" {
99- $DownloadUrl = " https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SQLEXPR_x64_ENU.exe "
105+ $WingetId = " Microsoft.SQLServer.2022.Express "
100106 $MajorVersion = 16
101107 }
108+ " 2025" {
109+ $WingetId = " Microsoft.SQLServer.2025.Express"
110+ $MajorVersion = 17
111+ }
102112 }
103113
104- Invoke-WebRequest $DownloadUrl - OutFile " C:\Downloads\mssql.exe"
105- Start-Process - Wait - FilePath " C:\Downloads\mssql.exe" - ArgumentList / qs, / x:" C:\Downloads\setup"
106- C:\Downloads\setup\setup.exe / q / ACTION= Install / INSTANCENAME= SQLEXPRESS / FEATURES= SQLEngine / UPDATEENABLED= 0 / SQLSVCACCOUNT= ' NT AUTHORITY\System' / SQLSYSADMINACCOUNTS= ' BUILTIN\ADMINISTRATORS' / TCPENABLED= 1 / NPENABLED= 0 / IACCEPTSQLSERVERLICENSETERMS
114+ & winget install - e -- id $WingetId -- accept- source- agreements -- accept- package- agreements -- verbose -- disable-interactivity
107115
108116 Write-Host " Configuring SQL Express ..."
109117 stop-service MSSQL`$ SQLEXPRESS
0 commit comments