Skip to content

Commit 55a450b

Browse files
committed
Add support for discontinued features in SQL Server 2025 and update tests
1 parent 34e016d commit 55a450b

File tree

4 files changed

+41
-8
lines changed

4 files changed

+41
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
### Added
99

10+
- `Test-SqlDscIsSupportedFeature`
11+
- Added DQ, DQC, and MDS features as discontinued starting with SQL Server 2025
12+
(17.x) and later versions ([issue #2380](https://github.com/dsccommunity/SqlServerDsc/issues/2380)).
1013
- Added public command `Get-SqlDscRSPackage` to retrieve package information for
1114
SQL Server Reporting Services or Power BI Report Server. Supports getting version
1215
information from an executable file

source/Private/Assert-SetupActionProperties.ps1

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,19 @@ function Assert-SetupActionProperties
4242
$SetupAction
4343
)
4444

45+
$setupExecutableFileVersion = $null
46+
47+
<#
48+
Assumes that the MediaPath parameter is always specified as this should
49+
only be called internally by Invoke-SetupAction that have MediaPath as a
50+
mandatory parameter.
51+
#>
52+
$setupExecutableFileVersion = $Property.MediaPath |
53+
Join-Path -ChildPath 'setup.exe' |
54+
Get-FileVersion
55+
4556
if ($Property.ContainsKey('Features'))
4657
{
47-
$setupExecutableFileVersion = $Property.MediaPath |
48-
Join-Path -ChildPath 'setup.exe' |
49-
Get-FileVersion
50-
5158
$Property.Features |
5259
Assert-Feature -ProductVersion $setupExecutableFileVersion.ProductVersion
5360
}
@@ -242,10 +249,6 @@ function Assert-SetupActionProperties
242249
# The parameter AllowDqRemoval is only allowed for SQL Server 2025 (17.x) and later versions.
243250
if ($Property.ContainsKey('AllowDqRemoval'))
244251
{
245-
$setupExecutableFileVersion = $Property.MediaPath |
246-
Join-Path -ChildPath 'setup.exe' |
247-
Get-FileVersion
248-
249252
$majorVersion = $setupExecutableFileVersion.ProductVersion.Split('.')[0]
250253

251254
if ([System.Int32] $majorVersion -lt 17)

source/Public/Test-SqlDscIsSupportedFeature.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function Test-SqlDscIsSupportedFeature
5454
13 = @('ADV_SSMS', 'SSMS') # cSpell: disable-line
5555
14 = @('RS', 'RS_SHP', 'RS_SHPWFE') # cSpell: disable-line
5656
16 = @('Tools', 'BC', 'CONN', 'BC', 'DREPLAY_CTLR', 'DREPLAY_CLT', 'SNAC_SDK', 'SDK', 'PolyBaseJava', 'SQL_INST_MR', 'SQL_INST_MPY', 'SQL_SHARED_MPY', 'SQL_SHARED_MR') # cSpell: disable-line
57+
17 = @('DQ', 'DQC', 'MDS') # Discontinued in SQL Server 2025 (17.x). See https://learn.microsoft.com/en-us/sql/database-engine/discontinued-database-engine-functionality-in-sql-server
5758
}
5859

5960
<#

tests/Unit/Public/Test-SqlDscIsSupportedFeature.Tests.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,30 @@ Describe 'Test-SqlDscIsSupportedFeature' -Tag 'Public' {
105105
Test-SqlDscIsSupportedFeature -Feature 'PolyBaseJava' -ProductVersion 14 | Should -BeFalse
106106
}
107107
}
108+
109+
Context 'When DQ, DQC, and MDS features are discontinued in SQL Server 2025 (17.x)' {
110+
It 'Should return $true for feature <Feature> on major version 16' -ForEach @(
111+
@{ Feature = 'DQ' }
112+
@{ Feature = 'DQC' }
113+
@{ Feature = 'MDS' }
114+
) {
115+
Test-SqlDscIsSupportedFeature -Feature $Feature -ProductVersion 16 | Should -BeTrue
116+
}
117+
118+
It 'Should return $false for feature <Feature> on major version 17' -ForEach @(
119+
@{ Feature = 'DQ' }
120+
@{ Feature = 'DQC' }
121+
@{ Feature = 'MDS' }
122+
) {
123+
Test-SqlDscIsSupportedFeature -Feature $Feature -ProductVersion 17 | Should -BeFalse
124+
}
125+
126+
It 'Should return $false for feature <Feature> on major version 999 (future version)' -ForEach @(
127+
@{ Feature = 'DQ' }
128+
@{ Feature = 'DQC' }
129+
@{ Feature = 'MDS' }
130+
) {
131+
Test-SqlDscIsSupportedFeature -Feature $Feature -ProductVersion 999 | Should -BeFalse
132+
}
133+
}
108134
}

0 commit comments

Comments
 (0)