From 34bae6f8c2d18ae1d9f8571a48f2b9089f06e9bf Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 14:02:22 +0100 Subject: [PATCH 01/28] Add SQL Server 2025 to integration tests --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 3 +- azure-pipelines.yml | 12 ++++++ source/Classes/020.SqlDatabase.ps1 | 2 +- .../DSC_SqlReplication.psm1 | 2 +- .../DSC_SqlSetup/DSC_SqlSetup.psm1 | 4 +- source/Public/New-SqlDscDatabase.ps1 | 3 +- .../Add-SqlDscFileGroup.Integration.Tests.ps1 | 2 +- .../Add-SqlDscTraceFlag.Integration.Tests.ps1 | 2 +- ...-SqlDscAgentOperator.Integration.Tests.ps1 | 2 +- .../Assert-SqlDscLogin.Integration.Tests.ps1 | 2 +- ...ackup-SqlDscDatabase.Integration.Tests.ps1 | 2 +- ...Complete-SqlDscImage.Integration.Tests.ps1 | 2 +- ...SqlDscDatabaseEngine.Integration.Tests.ps1 | 2 +- ...scDatabasePermission.Integration.Tests.ps1 | 2 +- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...ertTo-SqlDscDataFile.Integration.Tests.ps1 | 2 +- ...scDatabasePermission.Integration.Tests.ps1 | 2 +- ...To-SqlDscEditionName.Integration.Tests.ps1 | 2 +- ...rtTo-SqlDscFileGroup.Integration.Tests.ps1 | 2 +- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...-SqlDscAgentOperator.Integration.Tests.ps1 | 2 +- .../Disable-SqlDscAudit.Integration.Tests.ps1 | 2 +- ...aseSnapshotIsolation.Integration.Tests.ps1 | 2 +- .../Disable-SqlDscLogin.Integration.Tests.ps1 | 2 +- ...SqlDscDatabaseEngine.Integration.Tests.ps1 | 2 +- ...-SqlDscAgentOperator.Integration.Tests.ps1 | 2 +- .../Enable-SqlDscAudit.Integration.Tests.ps1 | 2 +- ...aseSnapshotIsolation.Integration.Tests.ps1 | 2 +- .../Enable-SqlDscLogin.Integration.Tests.ps1 | 2 +- ...Get-SqlDscAgentAlert.Integration.Tests.ps1 | 2 +- ...-SqlDscAgentOperator.Integration.Tests.ps1 | 2 +- .../Get-SqlDscAudit.Integration.Tests.ps1 | 2 +- ...SqlDscBackupFileList.Integration.Tests.ps1 | 2 +- ...scCompatibilityLevel.Integration.Tests.ps1 | 6 ++- ...cConfigurationOption.Integration.Tests.ps1 | 2 +- .../Get-SqlDscDatabase.Integration.Tests.ps1 | 2 +- ...scDatabasePermission.Integration.Tests.ps1 | 2 +- .../Get-SqlDscDateTime.Integration.Tests.ps1 | 2 +- .../Get-SqlDscLogin.Integration.Tests.ps1 | 2 +- ...qlDscManagedComputer.Integration.Tests.ps1 | 2 +- ...agedComputerInstance.Integration.Tests.ps1 | 2 +- ...nagedComputerService.Integration.Tests.ps1 | 2 +- ...qlDscPreferredModule.Integration.Tests.ps1 | 2 +- .../Get-SqlDscRole.Integration.Tests.ps1 | 2 +- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...SqlDscServerProtocol.Integration.Tests.ps1 | 2 +- ...scServerProtocolName.Integration.Tests.ps1 | 2 +- ...cServerProtocolTcpIp.Integration.Tests.ps1 | 2 +- .../Get-SqlDscSetupLog.Integration.Tests.ps1 | 2 +- ...lDscStartupParameter.Integration.Tests.ps1 | 2 +- .../Get-SqlDscTraceFlag.Integration.Tests.ps1 | 2 +- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...qlDscPreferredModule.Integration.Tests.ps1 | 2 +- ...qlDscFailoverCluster.Integration.Tests.ps1 | 2 +- ...itialize-SqlDscImage.Integration.Tests.ps1 | 2 +- ...qlDscRebuildDatabase.Integration.Tests.ps1 | 2 +- ...qlDscFailoverCluster.Integration.Tests.ps1 | 2 +- ...Install-SqlDscServer.Integration.Tests.ps1 | 2 +- .../Invoke-SqlDscQuery.Integration.Tests.ps1 | 2 +- ...ke-SqlDscScalarQuery.Integration.Tests.ps1 | 2 +- ...New-SqlDscAgentAlert.Integration.Tests.ps1 | 2 +- ...-SqlDscAgentOperator.Integration.Tests.ps1 | 2 +- .../New-SqlDscAudit.Integration.Tests.ps1 | 2 +- .../New-SqlDscDataFile.Integration.Tests.ps1 | 2 +- .../New-SqlDscDatabase.Integration.Tests.ps1 | 2 +- ...lDscDatabaseSnapshot.Integration.Tests.ps1 | 2 +- .../New-SqlDscFileGroup.Integration.Tests.ps1 | 2 +- .../New-SqlDscLogin.Integration.Tests.ps1 | 2 +- .../New-SqlDscRole.Integration.Tests.ps1 | 2 +- ...llationConfiguration.Integration.Tests.ps1 | 2 +- .../Prerequisites.Integration.Tests.ps1 | 24 ++++++++---- ...ove-SqlDscAgentAlert.Integration.Tests.ps1 | 2 +- ...-SqlDscAgentOperator.Integration.Tests.ps1 | 2 +- .../Remove-SqlDscAudit.Integration.Tests.ps1 | 2 +- ...emove-SqlDscDatabase.Integration.Tests.ps1 | 2 +- .../Remove-SqlDscLogin.Integration.Tests.ps1 | 2 +- .../Remove-SqlDscRole.Integration.Tests.ps1 | 2 +- ...move-SqlDscTraceFlag.Integration.Tests.ps1 | 2 +- .../Repair-SqlDscServer.Integration.Tests.ps1 | 2 +- ...store-SqlDscDatabase.Integration.Tests.ps1 | 2 +- ...esume-SqlDscDatabase.Integration.Tests.ps1 | 2 +- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...scSqlServerMediaFile.Integration.Tests.ps1 | 2 +- ...Set-SqlDscAgentAlert.Integration.Tests.ps1 | 2 +- ...-SqlDscAgentOperator.Integration.Tests.ps1 | 2 +- .../Set-SqlDscAudit.Integration.Tests.ps1 | 2 +- ...cConfigurationOption.Integration.Tests.ps1 | 2 +- ...qlDscDatabaseDefault.Integration.Tests.ps1 | 2 +- ...-SqlDscDatabaseOwner.Integration.Tests.ps1 | 2 +- ...scDatabasePermission.Integration.Tests.ps1 | 2 +- ...lDscDatabaseProperty.Integration.Tests.ps1 | 2 +- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...lDscStartupParameter.Integration.Tests.ps1 | 2 +- .../Set-SqlDscTraceFlag.Integration.Tests.ps1 | 2 +- ...spend-SqlDscDatabase.Integration.Tests.ps1 | 2 +- ...scAgentAlertProperty.Integration.Tests.ps1 | 2 +- ...est-SqlDscBackupFile.Integration.Tests.ps1 | 2 +- ...cConfigurationOption.Integration.Tests.ps1 | 2 +- ...lDscDatabaseProperty.Integration.Tests.ps1 | 2 +- ...t-SqlDscIsAgentAlert.Integration.Tests.ps1 | 2 +- ...qlDscIsAgentOperator.Integration.Tests.ps1 | 2 +- ...est-SqlDscIsDatabase.Integration.Tests.ps1 | 2 +- ...cIsDatabasePrincipal.Integration.Tests.ps1 | 2 +- .../Test-SqlDscIsLogin.Integration.Tests.ps1 | 2 +- ...SqlDscIsLoginEnabled.Integration.Tests.ps1 | 2 +- .../Test-SqlDscIsRole.Integration.Tests.ps1 | 2 +- ...scIsSupportedFeature.Integration.Tests.ps1 | 13 ++++++- ...lDscServerPermission.Integration.Tests.ps1 | 2 +- ...install-SqlDscServer.Integration.Tests.ps1 | 2 +- .../Update-SqlDscServer.Integration.Tests.ps1 | 2 +- ...-SqlDscServerEdition.Integration.Tests.ps1 | 2 +- ...AuditNewParameterSet.Integration.Tests.ps1 | 2 +- .../DSC_SqlAgentAlert.Integration.Tests.ps1 | 2 +- ...DSC_SqlAgentFailsafe.Integration.Tests.ps1 | 2 +- ...DSC_SqlAgentOperator.Integration.Tests.ps1 | 2 +- ...C_SqlAlwaysOnService.Integration.Tests.ps1 | 2 +- .../DSC_SqlAudit.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabase.Integration.Tests.ps1 | 2 +- ...abaseDefaultLocation.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabaseMail.Integration.Tests.ps1 | 2 +- ...baseObjectPermission.Integration.Tests.ps1 | 2 +- ...qlDatabasePermission.Integration.Tests.ps1 | 2 +- .../DSC_SqlDatabaseUser.Integration.Tests.ps1 | 2 +- .../DSC_SqlEndpoint.Integration.Tests.ps1 | 2 +- .../DSC_SqlLogin.Integration.Tests.ps1 | 2 +- .../DSC_SqlPermission.Integration.Tests.ps1 | 2 +- .../DSC_SqlProtocol.Integration.Tests.ps1 | 2 +- ...DSC_SqlProtocolTcpIp.Integration.Tests.ps1 | 2 +- .../DSC_SqlReplication.Integration.Tests.ps1 | 2 +- .../DSC_SqlRole.Integration.Tests.ps1 | 2 +- .../DSC_SqlScript.Integration.Tests.ps1 | 2 +- .../DSC_SqlScriptQuery.Integration.Tests.ps1 | 2 +- ..._SqlSecureConnection.Integration.Tests.ps1 | 2 +- ...SC_SqlServiceAccount.Integration.Tests.ps1 | 2 +- .../DSC_SqlSetup.Integration.Tests.ps1 | 39 +++++++++++++++++-- .../Resources/DSC_SqlSetup.config.ps1 | 19 +++++++++ .../DSC_SqlTraceFlag.Integration.Tests.ps1 | 2 +- ...C_SqlWindowsFirewall.Integration.Tests.ps1 | 2 +- .../Get-SqlDscCompatibilityLevel.Tests.ps1 | 37 ++++++++++++++++++ .../Unit/Public/New-SqlDscDatabase.Tests.ps1 | 35 +++++++++++++++++ 142 files changed, 306 insertions(+), 151 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e086072a6..bcc4ff97a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SqlServerDsc.Common - Moved functions into individual files and use ModuleBuilder to assemble. - - SqlServerDsc - Refactor integration tests for _SQL Server Reporting Services_ and _Power BI_ _Report Server_ ([issue #2431](https://github.com/dsccommunity/SqlServerDsc/issues/2431)). - `Connect-Sql` create connection and server objects as per documentation. - `Invoke-SqlDscQuery` remove disconnect as there is not an explicit connect. + - Add SQL Server 2025 to integration tests ([issue #2427](https://github.com/dsccommunity/SqlServerDsc/issues/2427)). ## [17.4.0] - 2026-01-19 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47010ac410..e5fb1f8ad8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -282,8 +282,7 @@ To make sure a integration tests is run in the correct order the integration tests are grouped in the file `azure-pipelines.yml` in the integration tests jobs. -There are three, separate, integration tests jobs that each, independently, test -SQL Server 2016, SQL Server 2017 and SQL Server 2019. +There are multiple, separate integration test jobs that independently test SQL Server 2017, SQL Server 2019, SQL Server 2022 and SQL Server 2025. ### Testing of examples files diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 84ab564e58..c4b23bad66 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -283,6 +283,9 @@ stages: SQL2022_WIN2025: JOB_VMIMAGE: 'windows-2025' TEST_CONFIGURATION: 'Integration_SQL2022' + SQL2025_WIN2025: + JOB_VMIMAGE: 'windows-2025' + TEST_CONFIGURATION: 'Integration_SQL2025' pool: vmImage: $(JOB_VMIMAGE) timeoutInMinutes: '0' @@ -452,6 +455,9 @@ stages: SQL2022_WIN2025: JOB_VMIMAGE: 'windows-2025' TEST_CONFIGURATION: 'Integration_SQL2022' + SQL2025_WIN2025: + JOB_VMIMAGE: 'windows-2025' + TEST_CONFIGURATION: 'Integration_SQL2025' pool: vmImage: $(JOB_VMIMAGE) timeoutInMinutes: '0' @@ -846,6 +852,9 @@ stages: SQL2022_WIN2025: JOB_VMIMAGE: 'windows-2025' TEST_CONFIGURATION: 'Integration_SQL2022' + SQL2025_WIN2025: + JOB_VMIMAGE: 'windows-2025' + TEST_CONFIGURATION: 'Integration_SQL2025' pool: vmImage: $(JOB_VMIMAGE) timeoutInMinutes: '0' @@ -938,6 +947,9 @@ stages: SQL2022_WIN2022: JOB_VMIMAGE: 'windows-2022' TEST_CONFIGURATION: 'Integration_SQL2022' + SQL2025_WIN2025: + JOB_VMIMAGE: 'windows-2025' + TEST_CONFIGURATION: 'Integration_SQL2025' pool: vmImage: $(JOB_VMIMAGE) timeoutInMinutes: '0' diff --git a/source/Classes/020.SqlDatabase.ps1 b/source/Classes/020.SqlDatabase.ps1 index 40f5447c83..8c653632f2 100644 --- a/source/Classes/020.SqlDatabase.ps1 +++ b/source/Classes/020.SqlDatabase.ps1 @@ -337,7 +337,7 @@ class SqlDatabase : SqlResourceBase $Collation [DscProperty()] - [ValidateSet('Version80', 'Version90', 'Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160')] + [ValidateSet('Version80', 'Version90', 'Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160', 'Version170')] [System.String] $CompatibilityLevel diff --git a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 index cd394097fc..fc7c8f5dfc 100644 --- a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 +++ b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 @@ -437,7 +437,7 @@ function New-ServerConnection $SqlServerName ) - if ($SqlMajorVersion -eq 16) + if ($SqlMajorVersion -in @(16, 17)) { <# For SQL Server 2022 the object must be created with New-Object and diff --git a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 index 293dc642c9..1ce37fb936 100644 --- a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 +++ b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 @@ -1119,7 +1119,7 @@ function Set-TargetResource # If SQL shared components already installed, clear InstallShared*Dir variables switch ($SqlVersion) { - { $_ -in ('10', '11', '12', '13', '14', '15', '16') } + { $_ -in ('10', '11', '12', '13', '14', '15', '16', '17') } { if ((Get-Variable -Name 'InstallSharedDir' -ErrorAction SilentlyContinue) -and (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\FEE2E540D20152D4597229B6CFBC0A69' -ErrorAction SilentlyContinue)) { @@ -3387,7 +3387,7 @@ function Get-SqlSharedPaths switch ($SqlServerMajorVersion) { - { $_ -in ('10', '11', '12', '13', '14', '15', '16') } + { $_ -in ('10', '11', '12', '13', '14', '15', '16', '17') } { $registryKeySharedDir = 'FEE2E540D20152D4597229B6CFBC0A69' $registryKeySharedWOWDir = 'A79497A344129F64CA7D69C56F5DD8B4' diff --git a/source/Public/New-SqlDscDatabase.ps1 b/source/Public/New-SqlDscDatabase.ps1 index d2bbcd0c38..388b4e1885 100644 --- a/source/Public/New-SqlDscDatabase.ps1 +++ b/source/Public/New-SqlDscDatabase.ps1 @@ -368,7 +368,7 @@ function New-SqlDscDatabase $CatalogCollation, [Parameter(ParameterSetName = 'Database')] - [ValidateSet('Version80', 'Version90', 'Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160')] + [ValidateSet('Version80', 'Version90', 'Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160', 'Version170')] [System.String] $CompatibilityLevel, @@ -738,6 +738,7 @@ function New-SqlDscDatabase 14 = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140') 15 = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150') 16 = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160') + 17 = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160', 'Version170') } if ($CompatibilityLevel -notin $supportedCompatibilityLevels.$($ServerObject.VersionMajor)) diff --git a/tests/Integration/Commands/Add-SqlDscFileGroup.Integration.Tests.ps1 b/tests/Integration/Commands/Add-SqlDscFileGroup.Integration.Tests.ps1 index 23377822a3..add8414706 100644 --- a/tests/Integration/Commands/Add-SqlDscFileGroup.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Add-SqlDscFileGroup.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Add-SqlDscFileGroup' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Add-SqlDscFileGroup' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Add-SqlDscTraceFlag.Integration.Tests.ps1 b/tests/Integration/Commands/Add-SqlDscTraceFlag.Integration.Tests.ps1 index 00705e6c5b..808754f838 100644 --- a/tests/Integration/Commands/Add-SqlDscTraceFlag.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Add-SqlDscTraceFlag.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Add-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Add-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Assert-SqlDscAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/Assert-SqlDscAgentOperator.Integration.Tests.ps1 index 44d6331e1f..c8dbcfdfcf 100644 --- a/tests/Integration/Commands/Assert-SqlDscAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Assert-SqlDscAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { $null = Remove-Item -Path 'Env:\SqlServerDscCI' -ErrorAction 'Stop' } -Describe 'Assert-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'Assert-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/Assert-SqlDscLogin.Integration.Tests.ps1 b/tests/Integration/Commands/Assert-SqlDscLogin.Integration.Tests.ps1 index 5482f595c5..35e6bc5e71 100644 --- a/tests/Integration/Commands/Assert-SqlDscLogin.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Assert-SqlDscLogin.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Assert-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Assert-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:instanceName = 'DSCSQLTEST' $script:computerName = Get-ComputerName diff --git a/tests/Integration/Commands/Backup-SqlDscDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Backup-SqlDscDatabase.Integration.Tests.ps1 index 089cc58081..9ff9f4c1f8 100644 --- a/tests/Integration/Commands/Backup-SqlDscDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Backup-SqlDscDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Backup-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Backup-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Complete-SqlDscImage.Integration.Tests.ps1 b/tests/Integration/Commands/Complete-SqlDscImage.Integration.Tests.ps1 index c30a2e791e..260b467606 100644 --- a/tests/Integration/Commands/Complete-SqlDscImage.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Complete-SqlDscImage.Integration.Tests.ps1 @@ -33,7 +33,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST, PrepareImage, CompleteImage -Describe 'Complete-SqlDscImage' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Complete-SqlDscImage' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Connect-SqlDscDatabaseEngine.Integration.Tests.ps1 b/tests/Integration/Commands/Connect-SqlDscDatabaseEngine.Integration.Tests.ps1 index 88e8490d04..f977d3cd43 100644 --- a/tests/Integration/Commands/Connect-SqlDscDatabaseEngine.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Connect-SqlDscDatabaseEngine.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Connect-SqlDscDatabaseEngine' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Connect-SqlDscDatabaseEngine' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/ConvertFrom-SqlDscDatabasePermission.Integration.Tests.ps1 b/tests/Integration/Commands/ConvertFrom-SqlDscDatabasePermission.Integration.Tests.ps1 index a3e0a30573..8d3aafc1b5 100644 --- a/tests/Integration/Commands/ConvertFrom-SqlDscDatabasePermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/ConvertFrom-SqlDscDatabasePermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'ConvertFrom-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertFrom-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { Context 'When converting DatabasePermission objects' { Context 'When converting a single permission Grant state' { It 'Should return a DatabasePermissionSet with correct permissions set' { diff --git a/tests/Integration/Commands/ConvertFrom-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/ConvertFrom-SqlDscServerPermission.Integration.Tests.ps1 index 2876ce45d5..4734f956d1 100644 --- a/tests/Integration/Commands/ConvertFrom-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/ConvertFrom-SqlDscServerPermission.Integration.Tests.ps1 @@ -35,7 +35,7 @@ BeforeAll { # in a realistic environment. Since this is a conversion utility that doesn't directly interact # with SQL Server, it tests the command's functionality with real ServerPermission objects # rather than requiring SQL Server connectivity. -Describe 'ConvertFrom-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertFrom-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { Context 'When converting ServerPermission objects in integration environment' { It 'Should convert single permission correctly' { # Use the module scope to create ServerPermission object properly diff --git a/tests/Integration/Commands/ConvertTo-SqlDscDataFile.Integration.Tests.ps1 b/tests/Integration/Commands/ConvertTo-SqlDscDataFile.Integration.Tests.ps1 index 3d0714330b..e6b968e10f 100644 --- a/tests/Integration/Commands/ConvertTo-SqlDscDataFile.Integration.Tests.ps1 +++ b/tests/Integration/Commands/ConvertTo-SqlDscDataFile.Integration.Tests.ps1 @@ -34,7 +34,7 @@ BeforeAll { Import-SqlDscPreferredModule } -Describe 'ConvertTo-SqlDscDataFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertTo-SqlDscDataFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/ConvertTo-SqlDscDatabasePermission.Integration.Tests.ps1 b/tests/Integration/Commands/ConvertTo-SqlDscDatabasePermission.Integration.Tests.ps1 index 6294138865..bc1722c56b 100644 --- a/tests/Integration/Commands/ConvertTo-SqlDscDatabasePermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/ConvertTo-SqlDscDatabasePermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'ConvertTo-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertTo-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/ConvertTo-SqlDscEditionName.Integration.Tests.ps1 b/tests/Integration/Commands/ConvertTo-SqlDscEditionName.Integration.Tests.ps1 index 52908eccf9..4b49c95f06 100644 --- a/tests/Integration/Commands/ConvertTo-SqlDscEditionName.Integration.Tests.ps1 +++ b/tests/Integration/Commands/ConvertTo-SqlDscEditionName.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'ConvertTo-SqlDscEditionName' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertTo-SqlDscEditionName' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/ConvertTo-SqlDscFileGroup.Integration.Tests.ps1 b/tests/Integration/Commands/ConvertTo-SqlDscFileGroup.Integration.Tests.ps1 index 51eb849c72..ebaa3c3e54 100644 --- a/tests/Integration/Commands/ConvertTo-SqlDscFileGroup.Integration.Tests.ps1 +++ b/tests/Integration/Commands/ConvertTo-SqlDscFileGroup.Integration.Tests.ps1 @@ -34,7 +34,7 @@ BeforeAll { Import-SqlDscPreferredModule } -Describe 'ConvertTo-SqlDscFileGroup' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertTo-SqlDscFileGroup' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/ConvertTo-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/ConvertTo-SqlDscServerPermission.Integration.Tests.ps1 index ca27d0bb31..6d8dcfa7be 100644 --- a/tests/Integration/Commands/ConvertTo-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/ConvertTo-SqlDscServerPermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'ConvertTo-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertTo-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Deny-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/Deny-SqlDscServerPermission.Integration.Tests.ps1 index c2f77646e8..47dffedb23 100644 --- a/tests/Integration/Commands/Deny-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Deny-SqlDscServerPermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Deny-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Deny-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Disable-SqlDscAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/Disable-SqlDscAgentOperator.Integration.Tests.ps1 index 2294fe5bdb..b1e3ffb5f4 100644 --- a/tests/Integration/Commands/Disable-SqlDscAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Disable-SqlDscAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Remove-Item -Path 'Env:\SqlServerDscCI' -ErrorAction 'SilentlyContinue' } -Describe 'Disable-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'Disable-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/Disable-SqlDscAudit.Integration.Tests.ps1 b/tests/Integration/Commands/Disable-SqlDscAudit.Integration.Tests.ps1 index a82fdb883d..de5b5ca325 100644 --- a/tests/Integration/Commands/Disable-SqlDscAudit.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Disable-SqlDscAudit.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Disable-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Disable-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Disable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 b/tests/Integration/Commands/Disable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 index 1c513ee394..bee60b7cf6 100644 --- a/tests/Integration/Commands/Disable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Disable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Disable-SqlDscDatabaseSnapshotIsolation' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Disable-SqlDscDatabaseSnapshotIsolation' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Disable-SqlDscLogin.Integration.Tests.ps1 b/tests/Integration/Commands/Disable-SqlDscLogin.Integration.Tests.ps1 index 5b2a0cdb88..7c37f87ae0 100644 --- a/tests/Integration/Commands/Disable-SqlDscLogin.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Disable-SqlDscLogin.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Disable-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Disable-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Disconnect-SqlDscDatabaseEngine.Integration.Tests.ps1 b/tests/Integration/Commands/Disconnect-SqlDscDatabaseEngine.Integration.Tests.ps1 index 8343ddd3c8..21a4b7cbd3 100644 --- a/tests/Integration/Commands/Disconnect-SqlDscDatabaseEngine.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Disconnect-SqlDscDatabaseEngine.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Disconnect-SqlDscDatabaseEngine' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Disconnect-SqlDscDatabaseEngine' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose } diff --git a/tests/Integration/Commands/Enable-SqlDscAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/Enable-SqlDscAgentOperator.Integration.Tests.ps1 index 1a6edb0dec..f0ad9a0f93 100644 --- a/tests/Integration/Commands/Enable-SqlDscAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Enable-SqlDscAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Remove-Item -Path 'Env:\SqlServerDscCI' -ErrorAction 'SilentlyContinue' } -Describe 'Enable-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'Enable-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/Enable-SqlDscAudit.Integration.Tests.ps1 b/tests/Integration/Commands/Enable-SqlDscAudit.Integration.Tests.ps1 index 82bc01bd4e..268c72bbc5 100644 --- a/tests/Integration/Commands/Enable-SqlDscAudit.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Enable-SqlDscAudit.Integration.Tests.ps1 @@ -33,7 +33,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Enable-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Enable-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Enable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 b/tests/Integration/Commands/Enable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 index 6e11532bf0..aad12b7876 100644 --- a/tests/Integration/Commands/Enable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Enable-SqlDscDatabaseSnapshotIsolation.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Enable-SqlDscDatabaseSnapshotIsolation' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Enable-SqlDscDatabaseSnapshotIsolation' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Enable-SqlDscLogin.Integration.Tests.ps1 b/tests/Integration/Commands/Enable-SqlDscLogin.Integration.Tests.ps1 index 26e43f798f..7a6a5d30ce 100644 --- a/tests/Integration/Commands/Enable-SqlDscLogin.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Enable-SqlDscLogin.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Enable-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Enable-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Get-SqlDscAgentAlert.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscAgentAlert.Integration.Tests.ps1 index 972cf5ab7f..d287b3bbe7 100644 --- a/tests/Integration/Commands/Get-SqlDscAgentAlert.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscAgentAlert.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { # Integration tests are run on the DSCSQLTEST instance $script:sqlServerInstance = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Get-SqlDscAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscAgentOperator.Integration.Tests.ps1 index 1d938f3d82..23a2154115 100644 --- a/tests/Integration/Commands/Get-SqlDscAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Remove-Item -Path 'Env:\SqlServerDscCI' -ErrorAction 'SilentlyContinue' } -Describe 'Get-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'Get-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/Get-SqlDscAudit.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscAudit.Integration.Tests.ps1 index 452aa553a3..2f20a542a7 100644 --- a/tests/Integration/Commands/Get-SqlDscAudit.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscAudit.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Get-SqlDscBackupFileList.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscBackupFileList.Integration.Tests.ps1 index 11da497662..e6214096ed 100644 --- a/tests/Integration/Commands/Get-SqlDscBackupFileList.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscBackupFileList.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscBackupFileList' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscBackupFileList' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Get-SqlDscCompatibilityLevel.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscCompatibilityLevel.Integration.Tests.ps1 index d2f38f7d1d..58913befee 100644 --- a/tests/Integration/Commands/Get-SqlDscCompatibilityLevel.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscCompatibilityLevel.Integration.Tests.ps1 @@ -30,7 +30,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Get-SqlDscCompatibilityLevel' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscCompatibilityLevel' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName @@ -64,6 +64,10 @@ Describe 'Get-SqlDscCompatibilityLevel' -Tag @('Integration_SQL2017', 'Integrati { $script:expectedLevels = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160') } + 17 # SQL Server 2025 + { + $script:expectedLevels = @('Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150', 'Version160', 'Version170') + } default { throw "Unsupported SQL Server version: $($script:serverObject.VersionMajor)" diff --git a/tests/Integration/Commands/Get-SqlDscConfigurationOption.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscConfigurationOption.Integration.Tests.ps1 index ce2a4accb2..4aa599b565 100644 --- a/tests/Integration/Commands/Get-SqlDscConfigurationOption.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscConfigurationOption.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Get-SqlDscDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscDatabase.Integration.Tests.ps1 index 11a62b4fe9..3947692af6 100644 --- a/tests/Integration/Commands/Get-SqlDscDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Get-SqlDscDatabasePermission.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscDatabasePermission.Integration.Tests.ps1 index 911c96378e..9b27afd435 100644 --- a/tests/Integration/Commands/Get-SqlDscDatabasePermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscDatabasePermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Get-SqlDscDateTime.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscDateTime.Integration.Tests.ps1 index e03a91e5a1..c93fb8c1cf 100644 --- a/tests/Integration/Commands/Get-SqlDscDateTime.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscDateTime.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscDateTime' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscDateTime' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Get-SqlDscLogin.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscLogin.Integration.Tests.ps1 index 6560a9fba0..4e3571b351 100644 --- a/tests/Integration/Commands/Get-SqlDscLogin.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscLogin.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Get-SqlDscManagedComputer.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscManagedComputer.Integration.Tests.ps1 index 8dda7b49ef..02dcb2e7ca 100644 --- a/tests/Integration/Commands/Get-SqlDscManagedComputer.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscManagedComputer.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Get-SqlDscManagedComputer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscManagedComputer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Get-SqlDscManagedComputerInstance.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscManagedComputerInstance.Integration.Tests.ps1 index a1b927707b..fbb6f90dde 100644 --- a/tests/Integration/Commands/Get-SqlDscManagedComputerInstance.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscManagedComputerInstance.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Get-SqlDscManagedComputerInstance' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscManagedComputerInstance' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Get-SqlDscManagedComputerService.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscManagedComputerService.Integration.Tests.ps1 index 2ced995855..76a687d565 100644 --- a/tests/Integration/Commands/Get-SqlDscManagedComputerService.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscManagedComputerService.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Get-SqlDscManagedComputerService' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscManagedComputerService' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Get-SqlDscPreferredModule.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscPreferredModule.Integration.Tests.ps1 index 98f7e88299..3f7c4a040c 100644 --- a/tests/Integration/Commands/Get-SqlDscPreferredModule.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscPreferredModule.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscPreferredModule' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscPreferredModule' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { Context 'When using default parameters' { It 'Should return a module object when preferred modules are available' { $result = Get-SqlDscPreferredModule -ErrorAction 'Stop' diff --git a/tests/Integration/Commands/Get-SqlDscRole.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscRole.Integration.Tests.ps1 index 0ffd81ab52..8c4d9b0832 100644 --- a/tests/Integration/Commands/Get-SqlDscRole.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscRole.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Get-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscServerPermission.Integration.Tests.ps1 index 940fa4922f..ced5cc13d0 100644 --- a/tests/Integration/Commands/Get-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscServerPermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Get-SqlDscServerProtocol.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscServerProtocol.Integration.Tests.ps1 index 026536ab2d..af37f3960a 100644 --- a/tests/Integration/Commands/Get-SqlDscServerProtocol.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscServerProtocol.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Get-SqlDscServerProtocol' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscServerProtocol' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Get-SqlDscServerProtocolName.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscServerProtocolName.Integration.Tests.ps1 index ef305c9a33..7fc8adf0da 100644 --- a/tests/Integration/Commands/Get-SqlDscServerProtocolName.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscServerProtocolName.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscServerProtocolName' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscServerProtocolName' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Get-SqlDscServerProtocolTcpIp.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscServerProtocolTcpIp.Integration.Tests.ps1 index 28a4910c00..e59df39b66 100644 --- a/tests/Integration/Commands/Get-SqlDscServerProtocolTcpIp.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscServerProtocolTcpIp.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Get-SqlDscServerProtocolTcpIp' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscServerProtocolTcpIp' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Get-SqlDscSetupLog.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscSetupLog.Integration.Tests.ps1 index 05b2b9395b..bf3b0d8ae8 100644 --- a/tests/Integration/Commands/Get-SqlDscSetupLog.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscSetupLog.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscSetupLog' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscSetupLog' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { Context 'When retrieving SQL Server setup log' { It 'Should retrieve the setup log from the most recent installation' { # This test verifies that Get-SqlDscSetupLog can successfully retrieve the diff --git a/tests/Integration/Commands/Get-SqlDscStartupParameter.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscStartupParameter.Integration.Tests.ps1 index 292b8deee7..24c879caf9 100644 --- a/tests/Integration/Commands/Get-SqlDscStartupParameter.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscStartupParameter.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Get-SqlDscStartupParameter' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscStartupParameter' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Get-SqlDscTraceFlag.Integration.Tests.ps1 b/tests/Integration/Commands/Get-SqlDscTraceFlag.Integration.Tests.ps1 index 499ff15ad8..40899f051b 100644 --- a/tests/Integration/Commands/Get-SqlDscTraceFlag.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Get-SqlDscTraceFlag.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Get-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Get-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Grant-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/Grant-SqlDscServerPermission.Integration.Tests.ps1 index b142762167..e912d0b44b 100644 --- a/tests/Integration/Commands/Grant-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Grant-SqlDscServerPermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Grant-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Grant-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Import-SqlDscPreferredModule.Integration.Tests.ps1 b/tests/Integration/Commands/Import-SqlDscPreferredModule.Integration.Tests.ps1 index 87cf3730e9..ab3a1a6e23 100644 --- a/tests/Integration/Commands/Import-SqlDscPreferredModule.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Import-SqlDscPreferredModule.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Import-SqlDscPreferredModule' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Import-SqlDscPreferredModule' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { # Store original environment variable value to restore later $script:originalSMODefaultModuleName = $env:SMODefaultModuleName diff --git a/tests/Integration/Commands/Initialize-SqlDscFailoverCluster.Integration.Tests.ps1 b/tests/Integration/Commands/Initialize-SqlDscFailoverCluster.Integration.Tests.ps1 index ee7a1296c9..76b49f36cd 100644 --- a/tests/Integration/Commands/Initialize-SqlDscFailoverCluster.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Initialize-SqlDscFailoverCluster.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Initialize-SqlDscFailoverCluster' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Initialize-SqlDscFailoverCluster' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $computerName = Get-ComputerName Write-Verbose -Message ("Running integration test as user '{0}' on computer '{1}'." -f $env:UserName, $computerName) -Verbose diff --git a/tests/Integration/Commands/Initialize-SqlDscImage.Integration.Tests.ps1 b/tests/Integration/Commands/Initialize-SqlDscImage.Integration.Tests.ps1 index 0c043d8f48..0e1cfd6b9e 100644 --- a/tests/Integration/Commands/Initialize-SqlDscImage.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Initialize-SqlDscImage.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore SQLSERVERAGENT, DSCSQLTEST -Describe 'Initialize-SqlDscImage' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Initialize-SqlDscImage' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $computerName = Get-ComputerName Write-Verbose -Message ("Running integration test as user '{0}' on computer '{1}'." -f $env:UserName, $computerName) -Verbose diff --git a/tests/Integration/Commands/Initialize-SqlDscRebuildDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Initialize-SqlDscRebuildDatabase.Integration.Tests.ps1 index 3045150324..7f3533d90a 100644 --- a/tests/Integration/Commands/Initialize-SqlDscRebuildDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Initialize-SqlDscRebuildDatabase.Integration.Tests.ps1 @@ -33,7 +33,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Initialize-SqlDscRebuildDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Initialize-SqlDscRebuildDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Install-SqlDscFailoverCluster.Integration.Tests.ps1 b/tests/Integration/Commands/Install-SqlDscFailoverCluster.Integration.Tests.ps1 index 311c5a0117..30d9253776 100644 --- a/tests/Integration/Commands/Install-SqlDscFailoverCluster.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Install-SqlDscFailoverCluster.Integration.Tests.ps1 @@ -37,7 +37,7 @@ AfterAll { $PSDefaultParameterValues.Remove('Should:ModuleName') } -Describe 'Install-SqlDscFailoverCluster Integration Tests' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Install-SqlDscFailoverCluster Integration Tests' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { <# Integration tests require a Windows Failover Cluster environment which is not available in the CI pipeline. Remove -Skip from the diff --git a/tests/Integration/Commands/Install-SqlDscServer.Integration.Tests.ps1 b/tests/Integration/Commands/Install-SqlDscServer.Integration.Tests.ps1 index b8b156abde..812e449083 100644 --- a/tests/Integration/Commands/Install-SqlDscServer.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Install-SqlDscServer.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore SQLSERVERAGENT, DSCSQLTEST -Describe 'Install-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Install-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Invoke-SqlDscQuery.Integration.Tests.ps1 b/tests/Integration/Commands/Invoke-SqlDscQuery.Integration.Tests.ps1 index 0413e32e3b..29e9f8401e 100644 --- a/tests/Integration/Commands/Invoke-SqlDscQuery.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Invoke-SqlDscQuery.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Invoke-SqlDscQuery' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Invoke-SqlDscQuery' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Invoke-SqlDscScalarQuery.Integration.Tests.ps1 b/tests/Integration/Commands/Invoke-SqlDscScalarQuery.Integration.Tests.ps1 index b5696df82c..53bacf31ca 100644 --- a/tests/Integration/Commands/Invoke-SqlDscScalarQuery.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Invoke-SqlDscScalarQuery.Integration.Tests.ps1 @@ -37,7 +37,7 @@ AfterAll { Remove-Item -Path 'env:SqlServerDscCI' -ErrorAction 'SilentlyContinue' } -Describe 'Invoke-SqlDscScalarQuery' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Invoke-SqlDscScalarQuery' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/New-SqlDscAgentAlert.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscAgentAlert.Integration.Tests.ps1 index fc8dac8d3d..ccce8bbf27 100644 --- a/tests/Integration/Commands/New-SqlDscAgentAlert.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscAgentAlert.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'New-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { # Integration tests are run on the DSCSQLTEST instance $script:sqlServerInstance = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/New-SqlDscAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscAgentOperator.Integration.Tests.ps1 index 0b125b98f0..61d6ec86b1 100644 --- a/tests/Integration/Commands/New-SqlDscAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Remove-Item -Path 'Env:\SqlServerDscCI' -ErrorAction 'SilentlyContinue' } -Describe 'New-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'New-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/New-SqlDscAudit.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscAudit.Integration.Tests.ps1 index 6381472f23..1f44929e01 100644 --- a/tests/Integration/Commands/New-SqlDscAudit.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscAudit.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'New-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/New-SqlDscDataFile.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscDataFile.Integration.Tests.ps1 index dd2c02486f..f4b07955ea 100644 --- a/tests/Integration/Commands/New-SqlDscDataFile.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscDataFile.Integration.Tests.ps1 @@ -34,7 +34,7 @@ BeforeAll { Import-SqlDscPreferredModule } -Describe 'New-SqlDscDataFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscDataFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/New-SqlDscDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscDatabase.Integration.Tests.ps1 index 76643888cd..672afe3f0d 100644 --- a/tests/Integration/Commands/New-SqlDscDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'New-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/New-SqlDscDatabaseSnapshot.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscDatabaseSnapshot.Integration.Tests.ps1 index 6e1d852626..e2a21c0af5 100644 --- a/tests/Integration/Commands/New-SqlDscDatabaseSnapshot.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscDatabaseSnapshot.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'New-SqlDscDatabaseSnapshot' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscDatabaseSnapshot' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/New-SqlDscFileGroup.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscFileGroup.Integration.Tests.ps1 index 1cd3048951..556e2a85bb 100644 --- a/tests/Integration/Commands/New-SqlDscFileGroup.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscFileGroup.Integration.Tests.ps1 @@ -34,7 +34,7 @@ BeforeAll { Import-SqlDscPreferredModule } -Describe 'New-SqlDscFileGroup' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscFileGroup' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/New-SqlDscLogin.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscLogin.Integration.Tests.ps1 index 61fe209fc9..5dcf018fd6 100644 --- a/tests/Integration/Commands/New-SqlDscLogin.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscLogin.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'New-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:instanceName = 'DSCSQLTEST' $script:computerName = Get-ComputerName diff --git a/tests/Integration/Commands/New-SqlDscRole.Integration.Tests.ps1 b/tests/Integration/Commands/New-SqlDscRole.Integration.Tests.ps1 index f76693e5f5..e6df6e7d43 100644 --- a/tests/Integration/Commands/New-SqlDscRole.Integration.Tests.ps1 +++ b/tests/Integration/Commands/New-SqlDscRole.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'New-SqlDscRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'New-SqlDscRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/PostInstallationConfiguration.Integration.Tests.ps1 b/tests/Integration/Commands/PostInstallationConfiguration.Integration.Tests.ps1 index 52e28ef7d2..9d38d579ba 100644 --- a/tests/Integration/Commands/PostInstallationConfiguration.Integration.Tests.ps1 +++ b/tests/Integration/Commands/PostInstallationConfiguration.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'PostInstallationConfiguration' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'PostInstallationConfiguration' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { Context 'When configuring SSL certificate for encryption support on DSCSQLTEST instance' { BeforeAll { $script:instanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 index 6226a3478f..d23a0dcc55 100644 --- a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 @@ -33,7 +33,7 @@ BeforeAll { # CSpell: ignore Remoting Describe 'Prerequisites' { - Context 'Create required local Windows users' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + Context 'Create required local Windows users' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { BeforeAll { $password = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force } @@ -60,7 +60,7 @@ Describe 'Prerequisites' { } } - Context 'Should create required local Windows service accounts' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + Context 'Should create required local Windows service accounts' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { BeforeAll { $password = ConvertTo-SecureString -String 'yig-C^Equ3' -AsPlainText -Force } @@ -101,7 +101,7 @@ Describe 'Prerequisites' { } } - Context 'Create required local Windows groups' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + Context 'Create required local Windows groups' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { It 'Should create SqlIntegrationTestGroup group' { $group = New-LocalGroup -Name 'SqlIntegrationTestGroup' -Description 'Local Windows group for SQL integration testing.' @@ -110,7 +110,7 @@ Describe 'Prerequisites' { } } - Context 'Add local Windows users to local groups' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') { + Context 'Add local Windows users to local groups' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI') { It 'Should add SqlInstall to local administrator group' { # Add user to local administrator group Add-LocalGroupMember -Group 'Administrators' -Member 'SqlInstall' @@ -164,9 +164,17 @@ Describe 'Prerequisites' { $mediaFile.Name | Should -Be 'media.iso' } + + It 'Should download SQL Server 2025 media' -Tag @('Integration_SQL2025') { + $url = 'https://download.microsoft.com/download/35b49aff-d8bb-43ba-8b3b-4ae1ae6963f3/SQL2025-SSEI-Eval.exe' + + $script:mediaFile = Save-SqlDscSqlServerMediaFile -Url $url -DestinationPath $env:TEMP -Force -Quiet -ErrorAction 'Stop' + + $mediaFile.Name | Should -Be 'media.iso' + } } - Context 'Mount SQL Server media' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + Context 'Mount SQL Server media' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { It 'Should mount the media to a drive letter' { $mountedImage = Mount-DiskImage -ImagePath $script:mediaFile $mountedImage | Should -BeOfType 'Microsoft.Management.Infrastructure.CimInstance' @@ -191,14 +199,14 @@ Describe 'Prerequisites' { } Context 'Install correct version of module SqlServer' { - It 'Should have the minimum required version of Microsoft.PowerShell.PSResourceGet' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + It 'Should have the minimum required version of Microsoft.PowerShell.PSResourceGet' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { $module = Get-Module -Name 'Microsoft.PowerShell.PSResourceGet' -ListAvailable $module.Count | Should -BeGreaterOrEqual 1 #$module.Version -ge '1.0.4.1' | Should -BeTrue } - It 'Should have a resource repository PSGallery with correct URI' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + It 'Should have a resource repository PSGallery with correct URI' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { $resourceRepository = Get-PSResourceRepository -Name 'PSGallery' $resourceRepository | Should -HaveCount 1 @@ -236,7 +244,7 @@ Describe 'Prerequisites' { } } - Context 'Test PS Remoting to localhost' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + Context 'Test PS Remoting to localhost' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { It 'Should successfully run a command on localhost using PS Remoting' { # This is a simple test to verify that PS Remoting is working. # TODO: This fails on Appveyor, but works locally when debugging on AppVeyor. Investigate why. diff --git a/tests/Integration/Commands/Remove-SqlDscAgentAlert.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscAgentAlert.Integration.Tests.ps1 index 9603f4004b..c1452a3c41 100644 --- a/tests/Integration/Commands/Remove-SqlDscAgentAlert.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscAgentAlert.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Remove-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Remove-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { # Integration tests are run on the DSCSQLTEST instance $script:sqlServerInstance = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Remove-SqlDscAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscAgentOperator.Integration.Tests.ps1 index 44e61ab514..6eed217159 100644 --- a/tests/Integration/Commands/Remove-SqlDscAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Remove-Item -Path 'Env:\SqlServerDscCI' -ErrorAction 'SilentlyContinue' } -Describe 'Remove-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'Remove-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/Remove-SqlDscAudit.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscAudit.Integration.Tests.ps1 index 5f70c703bb..21fb4e0efd 100644 --- a/tests/Integration/Commands/Remove-SqlDscAudit.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscAudit.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Remove-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Remove-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Remove-SqlDscDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscDatabase.Integration.Tests.ps1 index b77d400b56..2c603266d5 100644 --- a/tests/Integration/Commands/Remove-SqlDscDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Remove-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Remove-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Remove-SqlDscLogin.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscLogin.Integration.Tests.ps1 index e4831ce2bd..0f27eabb9c 100644 --- a/tests/Integration/Commands/Remove-SqlDscLogin.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscLogin.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Remove-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Remove-SqlDscLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Remove-SqlDscRole.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscRole.Integration.Tests.ps1 index 5c74fc82c5..9f5faff8c1 100644 --- a/tests/Integration/Commands/Remove-SqlDscRole.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscRole.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Remove-SqlDscRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Remove-SqlDscRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Remove-SqlDscTraceFlag.Integration.Tests.ps1 b/tests/Integration/Commands/Remove-SqlDscTraceFlag.Integration.Tests.ps1 index 9dcce1350a..7eebad9f89 100644 --- a/tests/Integration/Commands/Remove-SqlDscTraceFlag.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Remove-SqlDscTraceFlag.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Remove-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Remove-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Repair-SqlDscServer.Integration.Tests.ps1 b/tests/Integration/Commands/Repair-SqlDscServer.Integration.Tests.ps1 index b21fad0fa9..13a90b883e 100644 --- a/tests/Integration/Commands/Repair-SqlDscServer.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Repair-SqlDscServer.Integration.Tests.ps1 @@ -39,7 +39,7 @@ BeforeAll { SQL Server setup/repair process itself (might also be related to CI environmental factors, like too few resources). #> -Describe 'Repair-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') -Skip { +Describe 'Repair-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') -Skip { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Restore-SqlDscDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Restore-SqlDscDatabase.Integration.Tests.ps1 index 46f2096fc6..a6bab9b2e6 100644 --- a/tests/Integration/Commands/Restore-SqlDscDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Restore-SqlDscDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Restore-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Restore-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Resume-SqlDscDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Resume-SqlDscDatabase.Integration.Tests.ps1 index 08803c1603..af7acf0f26 100644 --- a/tests/Integration/Commands/Resume-SqlDscDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Resume-SqlDscDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Resume-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Resume-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Revoke-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/Revoke-SqlDscServerPermission.Integration.Tests.ps1 index e429b236ac..5b85f5bd77 100644 --- a/tests/Integration/Commands/Revoke-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Revoke-SqlDscServerPermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Revoke-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Revoke-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Save-SqlDscSqlServerMediaFile.Integration.Tests.ps1 b/tests/Integration/Commands/Save-SqlDscSqlServerMediaFile.Integration.Tests.ps1 index 21ea8b49d6..02f4c017ae 100644 --- a/tests/Integration/Commands/Save-SqlDscSqlServerMediaFile.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Save-SqlDscSqlServerMediaFile.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Save-SqlDscSqlServerMediaFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Save-SqlDscSqlServerMediaFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { # Create a temporary directory for testing downloads $script:testDownloadPath = Join-Path -Path $env:TEMP -ChildPath "SqlDscTestDownloads_$(Get-Random)" diff --git a/tests/Integration/Commands/Set-SqlDscAgentAlert.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscAgentAlert.Integration.Tests.ps1 index e5db106405..b2658c1a78 100644 --- a/tests/Integration/Commands/Set-SqlDscAgentAlert.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscAgentAlert.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { # Integration tests are run on the DSCSQLTEST instance $script:sqlServerInstance = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Set-SqlDscAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscAgentOperator.Integration.Tests.ps1 index 552baa723c..f25463e160 100644 --- a/tests/Integration/Commands/Set-SqlDscAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { Remove-Item -Path 'Env:\SqlServerDscCI' -ErrorAction 'SilentlyContinue' } -Describe 'Set-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'Set-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/Set-SqlDscAudit.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscAudit.Integration.Tests.ps1 index 539f11b5e6..26846575fe 100644 --- a/tests/Integration/Commands/Set-SqlDscAudit.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscAudit.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscAudit' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Set-SqlDscConfigurationOption.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscConfigurationOption.Integration.Tests.ps1 index 0419a88bff..a46550ce93 100644 --- a/tests/Integration/Commands/Set-SqlDscConfigurationOption.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscConfigurationOption.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Set-SqlDscDatabaseDefault.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscDatabaseDefault.Integration.Tests.ps1 index 740dbec1d1..f2073538ae 100644 --- a/tests/Integration/Commands/Set-SqlDscDatabaseDefault.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscDatabaseDefault.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscDatabaseDefault' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscDatabaseDefault' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Set-SqlDscDatabaseOwner.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscDatabaseOwner.Integration.Tests.ps1 index 1ed838a135..1ebd4560b5 100644 --- a/tests/Integration/Commands/Set-SqlDscDatabaseOwner.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscDatabaseOwner.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscDatabaseOwner' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscDatabaseOwner' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Set-SqlDscDatabasePermission.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscDatabasePermission.Integration.Tests.ps1 index 64cfd51ce8..434f0d2527 100644 --- a/tests/Integration/Commands/Set-SqlDscDatabasePermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscDatabasePermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscDatabasePermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Set-SqlDscDatabaseProperty.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscDatabaseProperty.Integration.Tests.ps1 index b47680de68..0b132c0ee2 100644 --- a/tests/Integration/Commands/Set-SqlDscDatabaseProperty.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscDatabaseProperty.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscDatabaseProperty' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscDatabaseProperty' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Set-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscServerPermission.Integration.Tests.ps1 index 974b0402fa..5e724e7c46 100644 --- a/tests/Integration/Commands/Set-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscServerPermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Set-SqlDscStartupParameter.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscStartupParameter.Integration.Tests.ps1 index 199074f5fe..eca509f288 100644 --- a/tests/Integration/Commands/Set-SqlDscStartupParameter.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscStartupParameter.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Set-SqlDscStartupParameter' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscStartupParameter' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose diff --git a/tests/Integration/Commands/Set-SqlDscTraceFlag.Integration.Tests.ps1 b/tests/Integration/Commands/Set-SqlDscTraceFlag.Integration.Tests.ps1 index 792a7fea7a..d5572737dc 100644 --- a/tests/Integration/Commands/Set-SqlDscTraceFlag.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Set-SqlDscTraceFlag.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Set-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Set-SqlDscTraceFlag' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockServerName = Get-ComputerName diff --git a/tests/Integration/Commands/Suspend-SqlDscDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Suspend-SqlDscDatabase.Integration.Tests.ps1 index 75a497686a..7f853df958 100644 --- a/tests/Integration/Commands/Suspend-SqlDscDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Suspend-SqlDscDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Suspend-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Suspend-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Test-SqlDscAgentAlertProperty.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscAgentAlertProperty.Integration.Tests.ps1 index b713317fb0..2027b563fe 100644 --- a/tests/Integration/Commands/Test-SqlDscAgentAlertProperty.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscAgentAlertProperty.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscAgentAlertProperty' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022'){ +Describe 'Test-SqlDscAgentAlertProperty' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025'){ BeforeAll { # Integration tests are run on the DSCSQLTEST instance $script:sqlServerInstance = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscBackupFile.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscBackupFile.Integration.Tests.ps1 index 8adbfee484..3159d7385a 100644 --- a/tests/Integration/Commands/Test-SqlDscBackupFile.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscBackupFile.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscBackupFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscBackupFile' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Test-SqlDscConfigurationOption.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscConfigurationOption.Integration.Tests.ps1 index 25b23201d0..a5ae5d42b9 100644 --- a/tests/Integration/Commands/Test-SqlDscConfigurationOption.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscConfigurationOption.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscDatabaseProperty.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscDatabaseProperty.Integration.Tests.ps1 index 20817c2c7d..4ce3a884d3 100644 --- a/tests/Integration/Commands/Test-SqlDscDatabaseProperty.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscDatabaseProperty.Integration.Tests.ps1 @@ -137,7 +137,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscDatabaseProperty' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscDatabaseProperty' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Commands/Test-SqlDscIsAgentAlert.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsAgentAlert.Integration.Tests.ps1 index f0fe48ab12..a0f0d1031f 100644 --- a/tests/Integration/Commands/Test-SqlDscIsAgentAlert.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsAgentAlert.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscIsAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022'){ +Describe 'Test-SqlDscIsAgentAlert' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025'){ BeforeAll { # Integration tests are run on the DSCSQLTEST instance $script:sqlServerInstance = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscIsAgentOperator.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsAgentOperator.Integration.Tests.ps1 index a35f2e9a7d..62ab86338e 100644 --- a/tests/Integration/Commands/Test-SqlDscIsAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsAgentOperator.Integration.Tests.ps1 @@ -40,7 +40,7 @@ AfterAll { $env:SqlServerDscCI = $null } -Describe 'Test-SqlDscIsAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022' { +Describe 'Test-SqlDscIsAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' { BeforeAll { $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception. $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force diff --git a/tests/Integration/Commands/Test-SqlDscIsDatabase.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsDatabase.Integration.Tests.ps1 index 72a55b4cfb..0eeb4c2fd3 100644 --- a/tests/Integration/Commands/Test-SqlDscIsDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsDatabase.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscIsDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscIsDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscIsDatabasePrincipal.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsDatabasePrincipal.Integration.Tests.ps1 index 051239f70f..d9c4dc7215 100644 --- a/tests/Integration/Commands/Test-SqlDscIsDatabasePrincipal.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsDatabasePrincipal.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscIsDatabasePrincipal' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscIsDatabasePrincipal' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscIsLogin.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsLogin.Integration.Tests.ps1 index 0a8b544203..3bce73574b 100644 --- a/tests/Integration/Commands/Test-SqlDscIsLogin.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsLogin.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscIsLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscIsLogin' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscIsLoginEnabled.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsLoginEnabled.Integration.Tests.ps1 index 540189444b..e7f96045de 100644 --- a/tests/Integration/Commands/Test-SqlDscIsLoginEnabled.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsLoginEnabled.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscIsLoginEnabled' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscIsLoginEnabled' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscIsRole.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsRole.Integration.Tests.ps1 index 8cf7b2a315..adf968015e 100644 --- a/tests/Integration/Commands/Test-SqlDscIsRole.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsRole.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscIsRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscIsRole' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Test-SqlDscIsSupportedFeature.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscIsSupportedFeature.Integration.Tests.ps1 index f7059bdabc..ff9ac2faf8 100644 --- a/tests/Integration/Commands/Test-SqlDscIsSupportedFeature.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscIsSupportedFeature.Integration.Tests.ps1 @@ -31,10 +31,10 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscIsSupportedFeature' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscIsSupportedFeature' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { Context 'When testing supported features for different SQL Server versions' { It 'Should return $true for SQLENGINE feature across all major versions' { - $testVersions = @('10', '11', '12', '13', '14', '15', '16') + $testVersions = @('10', '11', '12', '13', '14', '15', '16', '17') foreach ($version in $testVersions) { $result = Test-SqlDscIsSupportedFeature -Feature 'SQLENGINE' -ProductVersion $version -ErrorAction 'Stop' @@ -123,6 +123,15 @@ Describe 'Test-SqlDscIsSupportedFeature' -Tag @('Integration_SQL2016', 'Integrat $resultLower | Should -BeTrue } + It 'Should return $false for discontinued features DQ/DQC/MDS in SQL Server 2025 (version 17)' { + $discontinuedFeatures = @('DQ', 'DQC', 'MDS') + + foreach ($feature in $discontinuedFeatures) { + $result = Test-SqlDscIsSupportedFeature -Feature $feature -ProductVersion '17' -ErrorAction 'Stop' + $result | Should -BeFalse -Because "$feature is discontinued in SQL Server 2025" + } + } + It 'Should handle very high version numbers' { $result = Test-SqlDscIsSupportedFeature -Feature 'SQLENGINE' -ProductVersion '999' -ErrorAction 'Stop' $result | Should -BeTrue -Because "SQLENGINE should be supported in future versions" diff --git a/tests/Integration/Commands/Test-SqlDscServerPermission.Integration.Tests.ps1 b/tests/Integration/Commands/Test-SqlDscServerPermission.Integration.Tests.ps1 index 9de28860be..7bc80479cb 100644 --- a/tests/Integration/Commands/Test-SqlDscServerPermission.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Test-SqlDscServerPermission.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Test-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Test-SqlDscServerPermission' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' diff --git a/tests/Integration/Commands/Uninstall-SqlDscServer.Integration.Tests.ps1 b/tests/Integration/Commands/Uninstall-SqlDscServer.Integration.Tests.ps1 index 1892d0187c..2b792010fc 100644 --- a/tests/Integration/Commands/Uninstall-SqlDscServer.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Uninstall-SqlDscServer.Integration.Tests.ps1 @@ -32,7 +32,7 @@ BeforeAll { } # cSpell: ignore DSCSQLTEST -Describe 'Uninstall-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Uninstall-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose } diff --git a/tests/Integration/Commands/Update-SqlDscServer.Integration.Tests.ps1 b/tests/Integration/Commands/Update-SqlDscServer.Integration.Tests.ps1 index 8240cbe1b8..20da5c646c 100644 --- a/tests/Integration/Commands/Update-SqlDscServer.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Update-SqlDscServer.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Update-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Update-SqlDscServer' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $computerName = Get-ComputerName Write-Verbose -Message ("Running integration test as user '{0}' on computer '{1}'." -f $env:UserName, $computerName) -Verbose diff --git a/tests/Integration/Commands/Update-SqlDscServerEdition.Integration.Tests.ps1 b/tests/Integration/Commands/Update-SqlDscServerEdition.Integration.Tests.ps1 index 289ccc055c..0449d2e303 100644 --- a/tests/Integration/Commands/Update-SqlDscServerEdition.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Update-SqlDscServerEdition.Integration.Tests.ps1 @@ -31,7 +31,7 @@ BeforeAll { Import-Module -Name $script:moduleName -ErrorAction 'Stop' } -Describe 'Update-SqlDscServerEdition' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'Update-SqlDscServerEdition' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $computerName = Get-ComputerName Write-Verbose -Message ("Running integration test as user '{0}' on computer '{1}'." -f $env:UserName, $computerName) -Verbose diff --git a/tests/Integration/Private/ConvertTo-AuditNewParameterSet.Integration.Tests.ps1 b/tests/Integration/Private/ConvertTo-AuditNewParameterSet.Integration.Tests.ps1 index 4490f427f2..d206dd3b5c 100644 --- a/tests/Integration/Private/ConvertTo-AuditNewParameterSet.Integration.Tests.ps1 +++ b/tests/Integration/Private/ConvertTo-AuditNewParameterSet.Integration.Tests.ps1 @@ -37,7 +37,7 @@ AfterAll { $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') } -Describe 'ConvertTo-AuditNewParameterSet' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe 'ConvertTo-AuditNewParameterSet' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $script:mockInstanceName = 'DSCSQLTEST' $script:mockComputerName = Get-ComputerName diff --git a/tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1 index 50974c753b..fa00c74665 100644 --- a/tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlAgentFailsafe.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlAgentFailsafe.Integration.Tests.ps1 index 5ea422cec0..390cadf1e1 100644 --- a/tests/Integration/Resources/DSC_SqlAgentFailsafe.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlAgentFailsafe.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlAgentOperator.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlAgentOperator.Integration.Tests.ps1 index edc19fe850..7532dae44d 100644 --- a/tests/Integration/Resources/DSC_SqlAgentOperator.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlAgentOperator.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlAlwaysOnService.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlAlwaysOnService.Integration.Tests.ps1 index 999d5f5c5d..ad3a99c3c3 100644 --- a/tests/Integration/Resources/DSC_SqlAlwaysOnService.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlAlwaysOnService.Integration.Tests.ps1 @@ -70,7 +70,7 @@ AfterAll { TODO: This has temporarily been disabled as the test is not passing. Tags should be changed to @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') #> -Describe "$($script:dscResourceName)_Integration" -Tag 'Skip' { +Describe "$($script:dscResourceName)_Integration" -Skip { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlAudit.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlAudit.Integration.Tests.ps1 index de8dcd2b1b..d8f3484852 100644 --- a/tests/Integration/Resources/DSC_SqlAudit.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlAudit.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlDatabase.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlDatabase.Integration.Tests.ps1 index e47b43dbb1..c8af44d544 100644 --- a/tests/Integration/Resources/DSC_SqlDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlDatabase.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 index ad97d9ef30..346604c13e 100644 --- a/tests/Integration/Resources/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlDatabaseMail.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlDatabaseMail.Integration.Tests.ps1 index de2e53b4c5..b47b78b141 100644 --- a/tests/Integration/Resources/DSC_SqlDatabaseMail.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlDatabaseMail.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 index 45b3e44fc2..c328df1a8c 100644 --- a/tests/Integration/Resources/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlDatabasePermission.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlDatabasePermission.Integration.Tests.ps1 index 70fce2930a..7ce3cede48 100644 --- a/tests/Integration/Resources/DSC_SqlDatabasePermission.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlDatabasePermission.Integration.Tests.ps1 @@ -51,7 +51,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlDatabaseUser.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlDatabaseUser.Integration.Tests.ps1 index fe8a239ad7..4048c38fa6 100644 --- a/tests/Integration/Resources/DSC_SqlDatabaseUser.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlDatabaseUser.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlEndpoint.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlEndpoint.Integration.Tests.ps1 index bba0706669..0ebc78770b 100644 --- a/tests/Integration/Resources/DSC_SqlEndpoint.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlEndpoint.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlLogin.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlLogin.Integration.Tests.ps1 index 8598fc55bc..ff68c7d006 100644 --- a/tests/Integration/Resources/DSC_SqlLogin.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlLogin.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlPermission.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlPermission.Integration.Tests.ps1 index 8a485b1199..0e4dbd20a9 100644 --- a/tests/Integration/Resources/DSC_SqlPermission.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlPermission.Integration.Tests.ps1 @@ -51,7 +51,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlProtocol.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlProtocol.Integration.Tests.ps1 index efe96c200e..9d0734d0ba 100644 --- a/tests/Integration/Resources/DSC_SqlProtocol.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlProtocol.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 index 7194dc0047..fb8ed34ada 100644 --- a/tests/Integration/Resources/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlProtocolTcpIp.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlReplication.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlReplication.Integration.Tests.ps1 index cb5601048d..b6d225fdcf 100644 --- a/tests/Integration/Resources/DSC_SqlReplication.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlReplication.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlRole.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlRole.Integration.Tests.ps1 index 0cc7eceb83..30f227c349 100644 --- a/tests/Integration/Resources/DSC_SqlRole.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlRole.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlScript.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlScript.Integration.Tests.ps1 index 819387f6df..0280fb4ba4 100644 --- a/tests/Integration/Resources/DSC_SqlScript.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlScript.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlScriptQuery.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlScriptQuery.Integration.Tests.ps1 index 91269d67f8..9914a06454 100644 --- a/tests/Integration/Resources/DSC_SqlScriptQuery.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlScriptQuery.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 index 6a19a8f6cf..b6b7838b46 100644 --- a/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 @@ -64,7 +64,7 @@ AfterAll { Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlServiceAccount.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlServiceAccount.Integration.Tests.ps1 index 5e46f0f367..016420b4d3 100644 --- a/tests/Integration/Resources/DSC_SqlServiceAccount.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlServiceAccount.Integration.Tests.ps1 @@ -59,7 +59,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 index 715bc38099..ec8532e4c3 100644 --- a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 @@ -88,7 +88,12 @@ BeforeAll { The actual download URL can easiest be found in the browser download history. #> - if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022', 'Integration_PowerBI') + if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2025') + { + $script:sqlVersion = '170' + $script:mockSourceDownloadExeUrl = 'https://download.microsoft.com/download/35b49aff-d8bb-43ba-8b3b-4ae1ae6963f3/SQL2025-SSEI-Eval.exe' + } + elseif (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022', 'Integration_PowerBI') { $script:sqlVersion = '160' $script:mockSourceDownloadExeUrl = 'https://download.microsoft.com/download/c/c/9/cc9c6797-383c-4b24-8920-dc057c1de9d3/SQL2022-SSEI-Dev.exe' @@ -174,7 +179,7 @@ AfterAll { Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } @@ -292,6 +297,32 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', $null = Start-DscConfiguration @startDscConfigurationParameters } -ErrorVariable itBlockError + It 'Should install named instance on SQL Server 2025' -Tag @('Integration_SQL2025') { + if (-not (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2025')) + { + Skip -Reason 'Not running in SQL2025 integration job' + } + + $configurationParameters = @{ + OutputPath = $TestDrive + # The variable $ConfigurationData was dot-sourced above. + ConfigurationData = $ConfigurationData + } + + $null = & $configurationName @configurationParameters + + $startDscConfigurationParameters = @{ + Path = $TestDrive + ComputerName = 'localhost' + Wait = $true + Verbose = $true + Force = $true + ErrorAction = 'Stop' + } + + $null = Start-DscConfiguration @startDscConfigurationParameters + } + It 'Should be able to call Get-DscConfiguration without throwing' { $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction 'Stop' } @@ -637,7 +668,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', $resourceCurrentState.FailoverClusterIPAddress | Should -BeNullOrEmpty $resourceCurrentState.FailoverClusterNetworkName | Should -BeNullOrEmpty - if ($script:sqlVersion -in (160)) + if ($script:sqlVersion -in @('160','170')) { <# The features CONN, BC, SDK is no longer supported after SQL Server 2019. @@ -797,7 +828,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', $resourceCurrentState.FailoverClusterIPAddress | Should -BeNullOrEmpty $resourceCurrentState.FailoverClusterNetworkName | Should -BeNullOrEmpty - if ($script:sqlVersion -in (160)) + if ($script:sqlVersion -in @('160','170')) { <# The features CONN, BC, SDK is no longer supported after SQL Server 2019. diff --git a/tests/Integration/Resources/DSC_SqlSetup.config.ps1 b/tests/Integration/Resources/DSC_SqlSetup.config.ps1 index 6aaecea61e..177f900352 100644 --- a/tests/Integration/Resources/DSC_SqlSetup.config.ps1 +++ b/tests/Integration/Resources/DSC_SqlSetup.config.ps1 @@ -22,6 +22,25 @@ else #> switch ($script:sqlVersion) { + '170' + { + $versionSpecificData = @{ + SqlServerInstanceIdPrefix = 'MSSQL17' + AnalysisServiceInstanceIdPrefix = 'MSAS17' + IsoImageName = 'SQL2025.iso' + + # Additional variables required as ISO is downloaded via additional EXE + DownloadExeName = 'SQL2025_Download.exe' + DownloadIsoName = 'SQLServer2025-x64-ENU-Eval.iso' + + # Features CONN, BC, SDK, SNAC_SDK, DREPLAY_CLT, DREPLAY_CTLR are no longer supported in 2025. + SupportedFeatures = 'SQLENGINE,REPLICATION' + + SqlServerModuleVersion = '22.4.5.1' + DbatoolsModuleVersion = '2.0.1' + } + } + '160' { $versionSpecificData = @{ diff --git a/tests/Integration/Resources/DSC_SqlTraceFlag.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlTraceFlag.Integration.Tests.ps1 index 3ae956b550..561508c2f8 100644 --- a/tests/Integration/Resources/DSC_SqlTraceFlag.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlTraceFlag.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Integration/Resources/DSC_SqlWindowsFirewall.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlWindowsFirewall.Integration.Tests.ps1 index 58ccbbfd6a..d9c0dad58a 100644 --- a/tests/Integration/Resources/DSC_SqlWindowsFirewall.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlWindowsFirewall.Integration.Tests.ps1 @@ -50,7 +50,7 @@ AfterAll { Restore-TestEnvironment -TestEnvironment $script:testEnvironment } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } diff --git a/tests/Unit/Public/Get-SqlDscCompatibilityLevel.Tests.ps1 b/tests/Unit/Public/Get-SqlDscCompatibilityLevel.Tests.ps1 index 5ae2dc2dcb..0982cd80c8 100644 --- a/tests/Unit/Public/Get-SqlDscCompatibilityLevel.Tests.ps1 +++ b/tests/Unit/Public/Get-SqlDscCompatibilityLevel.Tests.ps1 @@ -96,6 +96,27 @@ Describe 'Get-SqlDscCompatibilityLevel' -Tag 'Public' { } } + Context 'When SQL Server version is 17 (SQL Server 2025)' { + BeforeAll { + $mockServerObject.VersionMajor = 17 + } + + It 'Should return all supported compatibility levels from 100 to 170' { + $result = Get-SqlDscCompatibilityLevel -ServerObject $mockServerObject + + $result | Should -Contain 'Version100' + $result | Should -Contain 'Version110' + $result | Should -Contain 'Version120' + $result | Should -Contain 'Version130' + $result | Should -Contain 'Version140' + $result | Should -Contain 'Version150' + $result | Should -Contain 'Version160' + $result | Should -Contain 'Version170' + $result | Should -Not -Contain 'Version90' + $result | Should -Not -Contain 'Version80' + } + } + Context 'When SQL Server version is 15 (SQL Server 2019)' { BeforeAll { $mockServerObject.VersionMajor = 15 @@ -184,6 +205,22 @@ Describe 'Get-SqlDscCompatibilityLevel' -Tag 'Public' { } } + Context 'When version is 17.0.1000.0 (SQL Server 2025)' { + It 'Should return all supported compatibility levels from 100 to 170' { + $result = Get-SqlDscCompatibilityLevel -Version '17.0.1000.0' + + $result | Should -Contain 'Version100' + $result | Should -Contain 'Version110' + $result | Should -Contain 'Version120' + $result | Should -Contain 'Version130' + $result | Should -Contain 'Version140' + $result | Should -Contain 'Version150' + $result | Should -Contain 'Version160' + $result | Should -Contain 'Version170' + $result | Should -Not -Contain 'Version90' + } + } + Context 'When version is 15.0.2000.5 (SQL Server 2019)' { It 'Should return all supported compatibility levels from 100 to 150' { $result = Get-SqlDscCompatibilityLevel -Version '15.0.2000.5' diff --git a/tests/Unit/Public/New-SqlDscDatabase.Tests.ps1 b/tests/Unit/Public/New-SqlDscDatabase.Tests.ps1 index 1ad50fdb20..3382615ef9 100644 --- a/tests/Unit/Public/New-SqlDscDatabase.Tests.ps1 +++ b/tests/Unit/Public/New-SqlDscDatabase.Tests.ps1 @@ -128,6 +128,41 @@ Describe 'New-SqlDscDatabase' -Tag 'Public' { $result.IsLedger | Should -BeTrue } + It 'Should create a ledger database on SQL Server 2025 (version 17) with IsLedger set to true' { + # Create a mock server for SQL Server 2025 (version 17) which should also support IsLedger + $mockServerObject2025 = New-Object -TypeName 'Microsoft.SqlServer.Management.Smo.Server' + $mockServerObject2025 | Add-Member -MemberType 'NoteProperty' -Name 'InstanceName' -Value 'TestInstance2025' -Force + $mockServerObject2025 | Add-Member -MemberType 'NoteProperty' -Name 'VersionMajor' -Value 17 -Force + $mockServerObject2025 | Add-Member -MemberType 'ScriptProperty' -Name 'Databases' -Value { + return @{} | Add-Member -MemberType 'ScriptMethod' -Name 'Refresh' -Value { + # Mock implementation + } -PassThru -Force + } -Force + + $result = New-SqlDscDatabase -ServerObject $mockServerObject2025 -Name 'LedgerDatabase2025' -IsLedger -Force + + $result | Should -Not -BeNullOrEmpty + $result.Name | Should -Be 'LedgerDatabase2025' + $result.IsLedger | Should -BeTrue + } + + It 'Should accept CompatibilityLevel Version170 on SQL Server 2025' { + # Mock a SQL Server 2025 server object + $mockServerObject2025 = New-Object -TypeName 'Microsoft.SqlServer.Management.Smo.Server' + $mockServerObject2025 | Add-Member -MemberType 'NoteProperty' -Name 'InstanceName' -Value 'TestInstance2025' -Force + $mockServerObject2025 | Add-Member -MemberType 'NoteProperty' -Name 'VersionMajor' -Value 17 -Force + $mockServerObject2025 | Add-Member -MemberType 'ScriptProperty' -Name 'Databases' -Value { + return @{} | Add-Member -MemberType 'ScriptMethod' -Name 'Refresh' -Value { + # Mock implementation + } -PassThru -Force + } -Force + + $result = New-SqlDscDatabase -ServerObject $mockServerObject2025 -Name 'TestDatabase170' -CompatibilityLevel 'Version170' -Force + + $result | Should -Not -BeNullOrEmpty + $result.CompatibilityLevel | Should -Be 'Version170' + } + It 'Should create a database with additional boolean properties set' { $result = New-SqlDscDatabase -ServerObject $mockServerObject -Name 'TestDatabaseWithProps' -AutoClose -AutoShrink -Force From 8876ce257d511397f323b3fe38a003d0cc511cfd Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 16:04:47 +0100 Subject: [PATCH 02/28] Add TLS protocol conversion and testing functions for SQL Server 2025 --- .../ConvertTo-TlsProtocolRegistryKeyName.ps1 | 67 +++++++ source/Public/Test-TlsProtocol.ps1 | 110 ++++++++++++ .../Prerequisites.Integration.Tests.ps1 | 11 ++ .../DSC_SqlSetup.Integration.Tests.ps1 | 11 ++ ...ertTo-TlsProtocolRegistryKeyName.Tests.ps1 | 89 ++++++++++ tests/Unit/Public/Test-TlsProtocol.Tests.ps1 | 167 ++++++++++++++++++ 6 files changed, 455 insertions(+) create mode 100644 source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 create mode 100644 source/Public/Test-TlsProtocol.ps1 create mode 100644 tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 create mode 100644 tests/Unit/Public/Test-TlsProtocol.Tests.ps1 diff --git a/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 b/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 new file mode 100644 index 0000000000..cb15ef4d1d --- /dev/null +++ b/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 @@ -0,0 +1,67 @@ +<# + .SYNOPSIS + Converts a friendly protocol identifier to the SCHANNEL registry key name. + + .DESCRIPTION + Maps user-friendly protocol names accepted by the public commands + (e.g. Tls12) to the actual SCHANNEL registry key names (e.g. 'TLS 1.2'). + + .PARAMETER Protocol + The protocol identifier, e.g. 'Tls12', 'Ssl3', 'Tls'. + + .OUTPUTS + System.String +#> +function ConvertTo-TlsProtocolRegistryKeyName +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $Protocol + ) + + $protocolRegistryKeyName = switch ($Protocol.ToLower()) + { + 'ssl2' + { + 'SSL 2.0' + } + + 'ssl3' + { + 'SSL 3.0' + } + + 'tls' + { + 'TLS 1.0' + } + + 'tls11' + { + 'TLS 1.1' + } + + 'tls12' + { + 'TLS 1.2' + } + + 'tls13' + { + 'TLS 1.3' + } + + default + { + $message = "Unknown protocol '$Protocol'. Valid values: Ssl2, Ssl3, Tls, Tls11, Tls12, Tls13." + $exception = New-Exception -Message $message + $errorRecord = New-ErrorRecord -Exception $exception -ErrorId 'InvalidProtocol' -ErrorCategory ([System.Management.Automation.ErrorCategory]::InvalidArgument) -TargetObject $Protocol + $PSCmdlet.ThrowTerminatingError($errorRecord) + } + } + + return $protocolRegistryKeyName +} diff --git a/source/Public/Test-TlsProtocol.ps1 b/source/Public/Test-TlsProtocol.ps1 new file mode 100644 index 0000000000..9adb894f70 --- /dev/null +++ b/source/Public/Test-TlsProtocol.ps1 @@ -0,0 +1,110 @@ +<# + .SYNOPSIS + Tests if specified TLS/SSL protocols are enabled on the local machine. + + .DESCRIPTION + Tests one or more SCHANNEL protocol keys under + HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols + to determine whether the protocol is enabled for server-side connections. + + .PARAMETER Protocol + One or more protocol names to check. Valid values: Ssl2, Ssl3, Tls, Tls11, Tls12, Tls13. + + .PARAMETER Client + When specified, will check the protocol `Client` registry + key instead of the default `Server` key. + + .PARAMETER Disabled + When specified, test that the protocol(s) are disabled. By default the + command tests that the protocol(s) are enabled. + + .OUTPUTS + System.Boolean +#> +function Test-TlsProtocol +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [Parameter(Mandatory = $true)] + [ValidateSet('Ssl2', 'Ssl3', 'Tls', 'Tls11', 'Tls12', 'Tls13', IgnoreCase = $true)] + [System.String[]] + $Protocol, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Client, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Disabled + ) + + foreach ($p in $Protocol) + { + $protocolTarget = if ($Client.IsPresent) { 'Client' } else { 'Server' } + + $protocolKeyName = ConvertTo-TlsProtocolRegistryKeyName -Protocol $p + + $regPath = "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\$protocolKeyName\\$protocolTarget" + + $protocolEnabled = Get-RegistryPropertyValue -Path $regPath -Name 'Enabled' -ErrorAction SilentlyContinue + $protocolDisabled = Get-RegistryPropertyValue -Path $regPath -Name 'DisabledByDefault' -ErrorAction SilentlyContinue + + $protocolEnabled = if ($null -ne $protocolEnabled) + { + [System.Int32] $protocolEnabled + } + else + { + $null + } + + $protocolDisabled = if ($null -ne $protocolDisabled) + { + [System.Int32] $protocolDisabled + } + else + { + $null + } + + if ($Disabled.IsPresent) + { + # Consider protocol enabled when both Enabled and DisabledByDefault are missing + if ($null -eq $protocolEnabled -and $null -eq $protocolDisabled) + { + return $false + } + + # Consider protocol disabled when Enabled != 1 or DisabledByDefault == 1 + if (($null -ne $protocolEnabled -and $protocolEnabled -ne 1) -or ($null -ne $protocolDisabled -and $protocolDisabled -eq 1)) + { + continue + } + else + { + return $false + } + } + else + { + if ($null -eq $protocolEnabled -and $null -eq $protocolDisabled) + { + continue + } + + if ($protocolEnabled -eq 1 -and $protocolDisabled -ne 1) + { + continue + } + else + { + return $false + } + } + } + + return $true +} diff --git a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 index d23a0dcc55..82a57fc271 100644 --- a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 @@ -254,6 +254,17 @@ Describe 'Prerequisites' { } } + Context 'Ensure TLS 1.2 is enabled' -Tag @('Integration_SQL2025') { + # SQL Server 2025 installation can fail when TLS 1.2 is disabled: + # https://learn.microsoft.com/en-us/sql/sql-server/sql-server-2025-known-issues?view=sql-server-ver17#sql-server-2025-installation-fails-when-tls-12-is-disabled + It 'Should have TLS 1.2 enabled on the node' -Tag @('Integration_SQL2025') { + # Test-TlsProtocol returns $true when the protocol is enabled. + # Assert for both Server and Client registry keys. + (Test-TlsProtocol -Protocol 'Tls12') | Should -BeTrue + (Test-TlsProtocol -Protocol 'Tls12' -Client) | Should -BeTrue + } + } + Context 'Download correct SQL Server 2017 Reporting Services installation executable' { It 'Should download SQL Server 2017 Reporting Services installation executable' -Tag @('Integration_SQL2017_RS') { # Microsoft SQL Server 2017 Reporting Services (14.0.601.20 - 2023-02-14) - https://www.microsoft.com/en-us/download/details.aspx?id=55252 diff --git a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 index ec8532e4c3..d1aa28c7d3 100644 --- a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 @@ -255,6 +255,17 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', } } + Context 'Ensure TLS 1.2 is enabled' -Tag @('Integration_SQL2025') { + # SQL Server 2025 installation can fail when TLS 1.2 is disabled: + # https://learn.microsoft.com/en-us/sql/sql-server/sql-server-2025-known-issues?view=sql-server-ver17#sql-server-2025-installation-fails-when-tls-12-is-disabled + It 'Should have TLS 1.2 enabled on the node' -Tag @('Integration_SQL2025') { + # Test-TlsProtocol returns $true when the protocol is enabled. + # Assert for both Server and Client registry keys. + (Test-TlsProtocol -Protocol 'Tls12') | Should -BeTrue + (Test-TlsProtocol -Protocol 'Tls12' -Client) | Should -BeTrue + } + } + Context ('When using configuration <_>') -ForEach @( "$($script:dscResourceName)_InstallDatabaseEngineNamedInstanceAsSystem_Config" ) -Skip:$(if ($env:SKIP_DATABASE_ENGINE_INSTANCE) { $true } else { $false }) { diff --git a/tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 b/tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 new file mode 100644 index 0000000000..d93587aeeb --- /dev/null +++ b/tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 @@ -0,0 +1,89 @@ +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] +param () + +BeforeDiscovery { + try + { + if (-not (Get-Module -Name 'DscResource.Test')) + { + if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) + { + & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null + } + + Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' + } + } + catch [System.IO.FileNotFoundException] + { + throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' + } +} + +BeforeAll { + $script:moduleName = 'SqlServerDsc' + + $env:SqlServerDscCI = $true + + Import-Module -Name $script:moduleName -ErrorAction 'Stop' + + $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName +} + +AfterAll { + $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') + $PSDefaultParameterValues.Remove('Mock:ModuleName') + $PSDefaultParameterValues.Remove('Should:ModuleName') + + Remove-Item -Path 'env:SqlServerDscCI' +} + +Describe 'ConvertTo-TlsProtocolRegistryKeyName' -Tag 'Private' { + Context 'When converting known friendly protocol names' { + It 'Maps Tls12 to TLS 1.2' { + InModuleScope -ScriptBlock { + ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls12' | Should -Be 'TLS 1.2' + } + } + + It 'Maps Tls11 to TLS 1.1' { + InModuleScope -ScriptBlock { + ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls11' | Should -Be 'TLS 1.1' + } + } + + It 'Maps Tls to TLS 1.0' { + InModuleScope -ScriptBlock { + ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls' | Should -Be 'TLS 1.0' + } + } + + It 'Maps Ssl3 to SSL 3.0' { + InModuleScope -ScriptBlock { + ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Ssl3' | Should -Be 'SSL 3.0' + } + } + + It 'Maps Ssl2 to SSL 2.0' { + InModuleScope -ScriptBlock { + ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Ssl2' | Should -Be 'SSL 2.0' + } + } + + It 'Maps Tls13 to TLS 1.3' { + InModuleScope -ScriptBlock { + ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls13' | Should -Be 'TLS 1.3' + } + } + } + + Context 'When given an unknown protocol' { + It 'Should throw a terminating error' { + InModuleScope -ScriptBlock { + { ConvertTo-TlsProtocolRegistryKeyName -Protocol 'NoSuchProto' } | Should -Throw -ErrorId 'InvalidProtocol,ConvertTo-TlsProtocolRegistryKeyName' + } + } + } +} diff --git a/tests/Unit/Public/Test-TlsProtocol.Tests.ps1 b/tests/Unit/Public/Test-TlsProtocol.Tests.ps1 new file mode 100644 index 0000000000..27d68cdc21 --- /dev/null +++ b/tests/Unit/Public/Test-TlsProtocol.Tests.ps1 @@ -0,0 +1,167 @@ +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] +param () + +BeforeDiscovery { + try + { + if (-not (Get-Module -Name 'DscResource.Test')) + { + if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) + { + & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null + } + + Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' + } + } + catch [System.IO.FileNotFoundException] + { + throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' + } +} + +BeforeAll { + $script:moduleName = 'SqlServerDsc' + + $env:SqlServerDscCI = $true + + Import-Module -Name $script:moduleName -ErrorAction 'Stop' + + $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName +} + +AfterAll { + $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') + $PSDefaultParameterValues.Remove('Mock:ModuleName') + $PSDefaultParameterValues.Remove('Should:ModuleName') + + Remove-Item -Path 'env:SqlServerDscCI' +} + +Describe 'Test-TlsProtocol' -Tag 'Public' { + Context 'When protocol is enabled in registry' { + BeforeAll { + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 1 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } + + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 0 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } + } + + It 'Should return $true' { + $result = Test-TlsProtocol -Protocol 'Tls12' + + $result | Should -BeTrue + } + } + + Context 'When protocol key is missing' { + BeforeAll { + Mock -CommandName Get-RegistryPropertyValue + } + + It 'Should return $true' { + $result = Test-TlsProtocol -Protocol 'Tls12' + + $result | Should -BeTrue + } + } + + Context 'When DisabledByDefault is set to 1' { + BeforeAll { + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 1 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } + + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 1 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } + } + + It 'Should return $false when DisabledByDefault is 1' { + $result = Test-TlsProtocol -Protocol 'Tls12' + + $result | Should -BeFalse + } + } + + Context 'When using the Client switch' { + BeforeAll { + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 1 + } -ParameterFilter { $Path -like '*\\Client' -and $Name -eq 'Enabled' } + + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 0 + } -ParameterFilter { $Path -like '*\\Client' -and $Name -eq 'DisabledByDefault' } + } + + It 'Should check the Client registry key' { + $result = Test-TlsProtocol -Protocol 'Tls12' -Client + + $result | Should -BeTrue + + Should -Invoke -CommandName Get-RegistryPropertyValue -ParameterFilter { + $Path -like '*\\Client' -and $Name -eq 'Enabled' + } -Exactly -Times 1 -Scope It + + Should -Invoke -CommandName Get-RegistryPropertyValue -ParameterFilter { + $Path -like '*\\Client' -and $Name -eq 'DisabledByDefault' + } -Exactly -Times 1 -Scope It + } + } + + Context 'When testing for Disabled protocols' { + Context 'When protocol is explicitly disabled' { + BeforeAll { + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 0 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } + + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 1 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } + } + + It 'Should return $true for -Disabled' { + $result = Test-TlsProtocol -Protocol 'Tls12' -Disabled + + $result | Should -BeTrue + } + } + + Context 'When protocol is enabled' { + BeforeAll { + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 1 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } + + Mock -CommandName Get-RegistryPropertyValue -MockWith { + return 0 + } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } + } + + It 'Should return $false for -Disabled' { + $result = Test-TlsProtocol -Protocol 'Tls12' -Disabled + + $result | Should -BeFalse + } + } + + Context 'When protocol key is missing' { + BeforeAll { + Mock -CommandName Get-RegistryPropertyValue + } + + It 'Should treat missing keys as enabled for -Disabled' { + $result = Test-TlsProtocol -Protocol 'Tls12' -Disabled + + $result | Should -BeFalse + } + } + } +} From e2d4af1365e73852adc40a94b48d340a7e57487d Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 16:10:29 +0100 Subject: [PATCH 03/28] Add SQL Server 2025 integration testing configuration --- azure-pipelines.yml | 3 +++ .../Resources/DSCv3_SqlDatabase.Integration.Tests.ps1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c4b23bad66..42f67c1fc3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1266,6 +1266,9 @@ stages: SQL2022_WIN2022: JOB_VMIMAGE: 'windows-2022' TEST_CONFIGURATION: 'Integration_SQL2022' + SQL2025_WIN2025: + JOB_VMIMAGE: 'windows-2025' + TEST_CONFIGURATION: 'Integration_SQL2025 pool: vmImage: $(JOB_VMIMAGE) timeoutInMinutes: 0 diff --git a/tests/Integration/Resources/DSCv3_SqlDatabase.Integration.Tests.ps1 b/tests/Integration/Resources/DSCv3_SqlDatabase.Integration.Tests.ps1 index 531c7f58ec..16eaa9f5ee 100644 --- a/tests/Integration/Resources/DSCv3_SqlDatabase.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSCv3_SqlDatabase.Integration.Tests.ps1 @@ -34,7 +34,7 @@ BeforeAll { $script:dscResourceFriendlyName = 'SqlDatabase' } -Describe "$($script:dscResourceFriendlyName)_Integration" -Tag @('Integration_SQL2022') { +Describe "$($script:dscResourceFriendlyName)_Integration" -Tag @('Integration_SQL2022', 'Integration_SQL2025') { BeforeAll { # Output the PowerShell version used in the test Write-Verbose -Message "`nPowerShell version used in integration test:`n$($PSVersionTable | Out-String)" -Verbose From 4eabb7973219c7e9dc7cfde25d5bd2be10e1f17f Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 16:45:23 +0100 Subject: [PATCH 04/28] Fix syntax error in SQL Server 2025 test configuration in azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 42f67c1fc3..ac76979eb7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1268,7 +1268,7 @@ stages: TEST_CONFIGURATION: 'Integration_SQL2022' SQL2025_WIN2025: JOB_VMIMAGE: 'windows-2025' - TEST_CONFIGURATION: 'Integration_SQL2025 + TEST_CONFIGURATION: 'Integration_SQL2025' pool: vmImage: $(JOB_VMIMAGE) timeoutInMinutes: 0 From c25851ccaa8a106c12eaf81bbb0b9dcdc90fb7a3 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 18:40:38 +0100 Subject: [PATCH 05/28] Add examples to ConvertTo-TlsProtocolRegistryKeyName and Test-TlsProtocol functions --- .../ConvertTo-TlsProtocolRegistryKeyName.ps1 | 5 +++++ source/Public/Test-TlsProtocol.ps1 | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 b/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 index cb15ef4d1d..df509b04bc 100644 --- a/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 +++ b/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 @@ -11,6 +11,11 @@ .OUTPUTS System.String + + .EXAMPLE + ConvertTo-TlsProtocolRegistryKeyName -Protocol Tls12 + + Returns the string 'TLS 1.2'. #> function ConvertTo-TlsProtocolRegistryKeyName { diff --git a/source/Public/Test-TlsProtocol.ps1 b/source/Public/Test-TlsProtocol.ps1 index 9adb894f70..75b58e3d8f 100644 --- a/source/Public/Test-TlsProtocol.ps1 +++ b/source/Public/Test-TlsProtocol.ps1 @@ -20,6 +20,16 @@ .OUTPUTS System.Boolean + + .EXAMPLE + Test-TlsProtocol -Protocol Tls12 + + Tests if TLS 1.2 is enabled for server-side connections. + + .EXAMPLE + Test-TlsProtocol -Protocol Tls13 -Client + + Tests if TLS 1.3 is enabled for client-side connections. #> function Test-TlsProtocol { @@ -27,6 +37,7 @@ function Test-TlsProtocol [OutputType([System.Boolean])] param ( + # TODO: Should use enum [System.Security.Authentication.SslProtocols] [Parameter(Mandatory = $true)] [ValidateSet('Ssl2', 'Ssl3', 'Tls', 'Tls11', 'Tls12', 'Tls13', IgnoreCase = $true)] [System.String[]] @@ -43,11 +54,7 @@ function Test-TlsProtocol foreach ($p in $Protocol) { - $protocolTarget = if ($Client.IsPresent) { 'Client' } else { 'Server' } - - $protocolKeyName = ConvertTo-TlsProtocolRegistryKeyName -Protocol $p - - $regPath = "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\$protocolKeyName\\$protocolTarget" + $regPath = Get-TlsProtocolRegistryPath -Protocol $p -Client:$Client $protocolEnabled = Get-RegistryPropertyValue -Path $regPath -Name 'Enabled' -ErrorAction SilentlyContinue $protocolDisabled = Get-RegistryPropertyValue -Path $regPath -Name 'DisabledByDefault' -ErrorAction SilentlyContinue From e0e4b9ee9772775c770556cd57372f1a3db10590 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 18:45:45 +0100 Subject: [PATCH 06/28] Update integration tests to include SQL Server 2025 in module version checks --- .../Integration/Commands/Prerequisites.Integration.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 index 82a57fc271..84dbf1adc7 100644 --- a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 @@ -228,7 +228,7 @@ Describe 'Prerequisites' { $module.Version -eq '21.1.18256' | Should -BeTrue } - It 'Should install SqlServer module version 22.2.0' -Tag @('Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + It 'Should install SqlServer module version 22.2.0' -Tag @('Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { #Install-Module -Name 'SqlServer' -RequiredVersion '22.2.0' -Force -ErrorAction 'Stop' $module = Install-PSResource -Name 'SqlServer' -Version '22.2.0' -Scope 'AllUsers' -TrustRepository -ErrorAction 'Stop' -Confirm:$false -PassThru @@ -236,7 +236,7 @@ Describe 'Prerequisites' { $module.Version -eq '22.2.0' | Should -BeTrue } - It 'Should have SqlServer module version 22.2.0 available' -Tag @('Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + It 'Should have SqlServer module version 22.2.0 available' -Tag @('Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { $module = Get-Module -Name 'SqlServer' -ListAvailable $module | Should -HaveCount 1 From 142b66aa014c10650b8247fd1b414411ed5317d0 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 18:59:15 +0100 Subject: [PATCH 07/28] Add functions to retrieve TLS protocol registry paths and targets --- .../Private/Get-TlsProtocolRegistryPath.ps1 | 41 +++++++++++ .../Get-TlsProtocolTargetRegistryName.ps1 | 32 +++++++++ .../Get-TlsProtocolRegistryPath.Tests.ps1 | 72 +++++++++++++++++++ ...et-TlsProtocolTargetRegistryName.Tests.ps1 | 59 +++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 source/Private/Get-TlsProtocolRegistryPath.ps1 create mode 100644 source/Private/Get-TlsProtocolTargetRegistryName.ps1 create mode 100644 tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 create mode 100644 tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 diff --git a/source/Private/Get-TlsProtocolRegistryPath.ps1 b/source/Private/Get-TlsProtocolRegistryPath.ps1 new file mode 100644 index 0000000000..f4e47aec75 --- /dev/null +++ b/source/Private/Get-TlsProtocolRegistryPath.ps1 @@ -0,0 +1,41 @@ +<# + .SYNOPSIS + Returns the SCHANNEL registry path for a given protocol and target. + + .DESCRIPTION + Builds the registry path under + HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols + for the provided friendly protocol name and selects the `Server` or + `Client` subkey depending on the `-Client` switch. + + .PARAMETER Protocol + The protocol identifier, e.g. 'Tls12'. + + .PARAMETER Client + When specified, return the path for the `Client` subkey, otherwise + return the `Server` subkey path. + + .OUTPUTS + System.String +#> +function Get-TlsProtocolRegistryPath +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Protocol, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Client + ) + + $protocolKeyName = ConvertTo-TlsProtocolRegistryKeyName -Protocol $Protocol + + $target = Get-TlsProtocolTargetRegistryName -Client:$Client + + return "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\$protocolKeyName\\$target" +} diff --git a/source/Private/Get-TlsProtocolTargetRegistryName.ps1 b/source/Private/Get-TlsProtocolTargetRegistryName.ps1 new file mode 100644 index 0000000000..2adfafb6bc --- /dev/null +++ b/source/Private/Get-TlsProtocolTargetRegistryName.ps1 @@ -0,0 +1,32 @@ +<# + .SYNOPSIS + Returns the SCHANNEL protocol target name for registry keys. + + .DESCRIPTION + Returns either 'Server' or 'Client' depending on the provided + `-Client` switch. This centralizes the logic used by public commands + for choosing the registry subkey name. + + .PARAMETER Client + When specified, return 'Client', otherwise return 'Server'. + + .OUTPUTS + System.String +#> +function Get-TlsProtocolTargetRegistryName +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Client + ) + + if ($Client.IsPresent) + { + return 'Client' + } + + return 'Server' +} diff --git a/tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 b/tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 new file mode 100644 index 0000000000..78c609b58f --- /dev/null +++ b/tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 @@ -0,0 +1,72 @@ + +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] +param () + +BeforeDiscovery { + try + { + if (-not (Get-Module -Name 'DscResource.Test')) + { + if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) + { + & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null + } + + Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' + } + } + catch [System.IO.FileNotFoundException] + { + throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' + } +} + +BeforeAll { + $script:moduleName = 'SqlServerDsc' + + $env:SqlServerDscCI = $true + + Import-Module -Name $script:moduleName -ErrorAction 'Stop' + + $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName +} + +AfterAll { + $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') + $PSDefaultParameterValues.Remove('Mock:ModuleName') + $PSDefaultParameterValues.Remove('Should:ModuleName') + + Remove-Item -Path 'env:SqlServerDscCI' +} + +Describe 'Get-TlsProtocolRegistryPath' -Tag 'Private' { + Context 'When building the registry path for Server' { + It 'returns server registry path for Tls12 by default' { + InModuleScope -ScriptBlock { + Mock -CommandName ConvertTo-TlsProtocolRegistryKeyName -MockWith { 'Tls12' } + Mock -CommandName Get-TlsProtocolTargetRegistryName -MockWith { 'Server' } + + $result = Get-TlsProtocolRegistryPath -Protocol 'Tls12' + + $expected = 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\Tls12\\Server' + $result | Should -Be $expected + } + } + } + + Context 'When building the registry path for Client' { + It 'returns client registry path when -Client is specified' { + InModuleScope -ScriptBlock { + Mock -CommandName ConvertTo-TlsProtocolRegistryKeyName -MockWith { 'Tls12' } + Mock -CommandName Get-TlsProtocolTargetRegistryName -MockWith { 'Client' } + + $result = Get-TlsProtocolRegistryPath -Protocol 'Tls12' -Client + + $expected = 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\Tls12\\Client' + $result | Should -Be $expected + } + } + } +} diff --git a/tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 b/tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 new file mode 100644 index 0000000000..732d015d15 --- /dev/null +++ b/tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 @@ -0,0 +1,59 @@ +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] +param () + +BeforeDiscovery { + try + { + if (-not (Get-Module -Name 'DscResource.Test')) + { + if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) + { + & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null + } + + Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' + } + } + catch [System.IO.FileNotFoundException] + { + throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' + } +} + +BeforeAll { + $script:moduleName = 'SqlServerDsc' + + $env:SqlServerDscCI = $true + + Import-Module -Name $script:moduleName -ErrorAction 'Stop' + + $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName + $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName +} + +AfterAll { + $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') + $PSDefaultParameterValues.Remove('Mock:ModuleName') + $PSDefaultParameterValues.Remove('Should:ModuleName') + + Remove-Item -Path 'env:SqlServerDscCI' +} + +Describe 'Get-TlsProtocolTargetRegistryName' -Tag 'Private' { + Context 'When Client switch is present' { + It 'returns Client' { + InModuleScope -ScriptBlock { + (Get-TlsProtocolTargetRegistryName -Client) | Should -Be 'Client' + } + } + } + + Context 'When Client switch is not present' { + It 'returns Server' { + InModuleScope -ScriptBlock { + (Get-TlsProtocolTargetRegistryName) | Should -Be 'Server' + } + } + } +} From 74dc89b9dbcd65ec922c92957656cf44b7c18da8 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 19:02:10 +0100 Subject: [PATCH 08/28] Add integration tests for SqlServer module version 22.4.5.1 --- .../Prerequisites.Integration.Tests.ps1 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 index 84dbf1adc7..ec29f859e8 100644 --- a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 @@ -228,7 +228,7 @@ Describe 'Prerequisites' { $module.Version -eq '21.1.18256' | Should -BeTrue } - It 'Should install SqlServer module version 22.2.0' -Tag @('Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + It 'Should install SqlServer module version 22.2.0' -Tag @('Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { #Install-Module -Name 'SqlServer' -RequiredVersion '22.2.0' -Force -ErrorAction 'Stop' $module = Install-PSResource -Name 'SqlServer' -Version '22.2.0' -Scope 'AllUsers' -TrustRepository -ErrorAction 'Stop' -Confirm:$false -PassThru @@ -236,12 +236,27 @@ Describe 'Prerequisites' { $module.Version -eq '22.2.0' | Should -BeTrue } - It 'Should have SqlServer module version 22.2.0 available' -Tag @('Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { + It 'Should have SqlServer module version 22.2.0 available' -Tag @('Integration_SQL2022', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { $module = Get-Module -Name 'SqlServer' -ListAvailable $module | Should -HaveCount 1 $module.Version -eq '22.2.0' | Should -BeTrue } + + It 'Should install SqlServer module version 22.4.5.1' -Tag @('Integration_SQL2025') { + #Install-Module -Name 'SqlServer' -RequiredVersion '22.4.5.1' -Force -ErrorAction 'Stop' + $module = Install-PSResource -Name 'SqlServer' -Version '22.4.5.1' -Scope 'AllUsers' -TrustRepository -ErrorAction 'Stop' -Confirm:$false -PassThru + + $module | Should -HaveCount 1 + $module.Version -eq '22.4.5.1' | Should -BeTrue + } + + It 'Should have SqlServer module version 22.4.5.1 available' -Tag @('Integration_SQL2025') { + $module = Get-Module -Name 'SqlServer' -ListAvailable + + $module | Should -HaveCount 1 + $module.Version -eq '22.4.5.1' | Should -BeTrue + } } Context 'Test PS Remoting to localhost' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025', 'Integration_PowerBI', 'Integration_SQL2017_RS', 'Integration_SQL2019_RS', 'Integration_SQL2022_RS') { From 095eb3b70b26b3a594f286b489f55bdd5c0a8eb3 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 19:17:45 +0100 Subject: [PATCH 09/28] Add output type annotations and examples to TLS protocol functions --- .../ConvertTo-TlsProtocolRegistryKeyName.ps1 | 1 + source/Private/Get-TlsProtocolRegistryPath.ps1 | 13 +++++++++++++ .../Private/Get-TlsProtocolTargetRegistryName.ps1 | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 b/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 index df509b04bc..ca049a2705 100644 --- a/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 +++ b/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 @@ -20,6 +20,7 @@ function ConvertTo-TlsProtocolRegistryKeyName { [CmdletBinding()] + [OutputType([System.String])] param ( [Parameter(Mandatory = $true)] diff --git a/source/Private/Get-TlsProtocolRegistryPath.ps1 b/source/Private/Get-TlsProtocolRegistryPath.ps1 index f4e47aec75..05a027f4a3 100644 --- a/source/Private/Get-TlsProtocolRegistryPath.ps1 +++ b/source/Private/Get-TlsProtocolRegistryPath.ps1 @@ -17,10 +17,23 @@ .OUTPUTS System.String + + .EXAMPLE + Get-TlsProtocolRegistryPath -Protocol Tls12 + + Returns the string: + 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server'. + + .EXAMPLE + Get-TlsProtocolRegistryPath -Protocol Tls13 -Client + + Returns the string: + 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client'. #> function Get-TlsProtocolRegistryPath { [CmdletBinding()] + [OutputType([System.String])] param ( [Parameter(Mandatory = $true)] diff --git a/source/Private/Get-TlsProtocolTargetRegistryName.ps1 b/source/Private/Get-TlsProtocolTargetRegistryName.ps1 index 2adfafb6bc..4d1182b584 100644 --- a/source/Private/Get-TlsProtocolTargetRegistryName.ps1 +++ b/source/Private/Get-TlsProtocolTargetRegistryName.ps1 @@ -12,6 +12,16 @@ .OUTPUTS System.String + + .EXAMPLE + Get-TlsProtocolTargetRegistryName + + Returns the string 'Server'. + + .EXAMPLE + Get-TlsProtocolTargetRegistryName -Client + + Returns the string 'Client'. #> function Get-TlsProtocolTargetRegistryName { From b77e9bb834dddc71ab429c289aa02e3f57d788d3 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 20:05:13 +0100 Subject: [PATCH 10/28] Add output type annotation to Get-TlsProtocolTargetRegistryName function --- source/Private/Get-TlsProtocolTargetRegistryName.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Private/Get-TlsProtocolTargetRegistryName.ps1 b/source/Private/Get-TlsProtocolTargetRegistryName.ps1 index 4d1182b584..cafb04cfda 100644 --- a/source/Private/Get-TlsProtocolTargetRegistryName.ps1 +++ b/source/Private/Get-TlsProtocolTargetRegistryName.ps1 @@ -26,6 +26,7 @@ function Get-TlsProtocolTargetRegistryName { [CmdletBinding()] + [OutputType([System.String])] param ( [Parameter()] From a9a3edb706d77b5619d14e9b26b518b5ef516265 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 24 Jan 2026 21:52:36 +0100 Subject: [PATCH 11/28] Remove SQL Server 2025 integration test for named instance installation --- .../DSC_SqlSetup.Integration.Tests.ps1 | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 index d1aa28c7d3..86b7222529 100644 --- a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 @@ -308,32 +308,6 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', $null = Start-DscConfiguration @startDscConfigurationParameters } -ErrorVariable itBlockError - It 'Should install named instance on SQL Server 2025' -Tag @('Integration_SQL2025') { - if (-not (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2025')) - { - Skip -Reason 'Not running in SQL2025 integration job' - } - - $configurationParameters = @{ - OutputPath = $TestDrive - # The variable $ConfigurationData was dot-sourced above. - ConfigurationData = $ConfigurationData - } - - $null = & $configurationName @configurationParameters - - $startDscConfigurationParameters = @{ - Path = $TestDrive - ComputerName = 'localhost' - Wait = $true - Verbose = $true - Force = $true - ErrorAction = 'Stop' - } - - $null = Start-DscConfiguration @startDscConfigurationParameters - } - It 'Should be able to call Get-DscConfiguration without throwing' { $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction 'Stop' } From cf042de68ed32d324a687bc2b669f1544c25f3e4 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sun, 25 Jan 2026 10:40:03 +0100 Subject: [PATCH 12/28] Update SQL Server 2025 media download links and configuration for EntDev edition --- tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 | 2 +- tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 | 2 +- tests/Integration/Resources/DSC_SqlSetup.config.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 index ec29f859e8..83cff34fff 100644 --- a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 @@ -166,7 +166,7 @@ Describe 'Prerequisites' { } It 'Should download SQL Server 2025 media' -Tag @('Integration_SQL2025') { - $url = 'https://download.microsoft.com/download/35b49aff-d8bb-43ba-8b3b-4ae1ae6963f3/SQL2025-SSEI-Eval.exe' + $url = 'https://download.microsoft.com/download/4ba126fc-a6a0-4810-80e9-c0182d3e1f62/SQL2025-SSEI-EntDev.exe' $script:mediaFile = Save-SqlDscSqlServerMediaFile -Url $url -DestinationPath $env:TEMP -Force -Quiet -ErrorAction 'Stop' diff --git a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 index 86b7222529..9c92008a1c 100644 --- a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 @@ -91,7 +91,7 @@ BeforeAll { if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2025') { $script:sqlVersion = '170' - $script:mockSourceDownloadExeUrl = 'https://download.microsoft.com/download/35b49aff-d8bb-43ba-8b3b-4ae1ae6963f3/SQL2025-SSEI-Eval.exe' + $script:mockSourceDownloadExeUrl = 'https://download.microsoft.com/download/4ba126fc-a6a0-4810-80e9-c0182d3e1f62/SQL2025-SSEI-EntDev.exe' } elseif (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022', 'Integration_PowerBI') { diff --git a/tests/Integration/Resources/DSC_SqlSetup.config.ps1 b/tests/Integration/Resources/DSC_SqlSetup.config.ps1 index 177f900352..31d99935ee 100644 --- a/tests/Integration/Resources/DSC_SqlSetup.config.ps1 +++ b/tests/Integration/Resources/DSC_SqlSetup.config.ps1 @@ -31,7 +31,7 @@ else # Additional variables required as ISO is downloaded via additional EXE DownloadExeName = 'SQL2025_Download.exe' - DownloadIsoName = 'SQLServer2025-x64-ENU-Eval.iso' + DownloadIsoName = 'SQLServer2025-x64-ENU-EntDev.iso' # Features CONN, BC, SDK, SNAC_SDK, DREPLAY_CLT, DREPLAY_CTLR are no longer supported in 2025. SupportedFeatures = 'SQLENGINE,REPLICATION' From e1c5d5b4e239a713078df4536b103dda468e8942 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sun, 25 Jan 2026 14:44:38 +0100 Subject: [PATCH 13/28] Implement workaround for SQL Server 2025 distributor installation using stored procedure --- .../DSC_SqlReplication.psm1 | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 index fc7c8f5dfc..184ba72ab6 100644 --- a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 +++ b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 @@ -621,15 +621,39 @@ function Install-RemoteDistributor $script:localizedData.InstallRemoteDistributor -f $RemoteDistributor ) - try + $instance = $ReplicationServer.Name + + $sqlMajorVersion = Get-SqlInstanceMajorVersion -InstanceName $instance + + if ($sqlMajorVersion -eq 17) { - $ReplicationServer.InstallDistributor($RemoteDistributor, $AdminLinkCredentials.Password) + $clearTextPassword = $AdminLinkCredentials.GetNetworkCredential().Password + + <# + Need to execute stored procedure sp_adddistributor for SQL Server 2025. + Workaround for issue: https://github.com/dsccommunity/SqlServerDsc/pull/2435#issuecomment-3796616952 + + TODO: Should support encrypted connection in the future, then we could + probably go back to using InstallDistributor(), another option is + to move to stored procedures for all of the Replication logic. + #> + $query = "EXECUTE sys.sp_adddistributor @distributor = N'$RemoteDistributor', @password = N'$clearTextPassword', @encrypt_distributor_connection = 'optional', @trust_distributor_certificate = 'yes';" + + # TODO: This need to pass a credential in the future, now connects using the one resource is run as. + Invoke-SqlDscQuery -InstanceName $instance -DatabaseName 'master' -Query $query -RedactText $clearTextPassword -Force -ErrorAction 'Stop' } - catch + else { - $errorMessage = $script:localizedData.FailedInFunction -f 'Install-RemoteDistributor' + try + { + $ReplicationServer.InstallDistributor($RemoteDistributor, $AdminLinkCredentials.Password) + } + catch + { + $errorMessage = $script:localizedData.FailedInFunction -f 'Install-RemoteDistributor' - New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ + New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ + } } } From ba660a01a92469fd917c359fda145404cad503d0 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sun, 25 Jan 2026 16:59:02 +0100 Subject: [PATCH 14/28] Refactor Install-RemoteDistributor to use Connect-SqlDscDatabaseEngine for SQL instance connection --- .../DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 index 184ba72ab6..97ad3bc048 100644 --- a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 +++ b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 @@ -621,9 +621,9 @@ function Install-RemoteDistributor $script:localizedData.InstallRemoteDistributor -f $RemoteDistributor ) - $instance = $ReplicationServer.Name + $serverObject = Connect-SqlDscDatabaseEngine -InstanceName $ReplicationServer.Name -ErrorAction 'Stop' - $sqlMajorVersion = Get-SqlInstanceMajorVersion -InstanceName $instance + $sqlMajorVersion = $serverObject.VersionMajor if ($sqlMajorVersion -eq 17) { @@ -640,7 +640,7 @@ function Install-RemoteDistributor $query = "EXECUTE sys.sp_adddistributor @distributor = N'$RemoteDistributor', @password = N'$clearTextPassword', @encrypt_distributor_connection = 'optional', @trust_distributor_certificate = 'yes';" # TODO: This need to pass a credential in the future, now connects using the one resource is run as. - Invoke-SqlDscQuery -InstanceName $instance -DatabaseName 'master' -Query $query -RedactText $clearTextPassword -Force -ErrorAction 'Stop' + Invoke-SqlDscQuery -ServerObject $serverObject -DatabaseName 'master' -Query $query -RedactText $clearTextPassword -Force -ErrorAction 'Stop' } else { From 8c917c5cf3c42b6e9d0307676563a2b7a751469b Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sun, 25 Jan 2026 20:23:47 +0100 Subject: [PATCH 15/28] Add InstanceName parameter to Install-RemoteDistributor and update usage --- .../DSC_SqlReplication/DSC_SqlReplication.psm1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 index 97ad3bc048..b359f7ad75 100644 --- a/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 +++ b/source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 @@ -287,7 +287,8 @@ function Set-TargetResource Install-RemoteDistributor ` -ReplicationServer $localReplicationServer ` -RemoteDistributor $RemoteDistributor ` - -AdminLinkCredentials $AdminLinkCredentials + -AdminLinkCredentials $AdminLinkCredentials ` + -InstanceName $InstanceName } } else #'Absent' @@ -598,6 +599,9 @@ function New-DistributionPublisher .PARAMETER AdminLinkCredentials AdminLink password to be used when setting up publisher distributor relationship. + + .PARAMETER InstanceName + SQL Server instance name where replication distribution will be configured. #> function Install-RemoteDistributor { @@ -614,14 +618,18 @@ function Install-RemoteDistributor [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] - $AdminLinkCredentials + $AdminLinkCredentials, + + [Parameter(Mandatory = $true)] + [System.String] + $InstanceName ) Write-Verbose -Message ( $script:localizedData.InstallRemoteDistributor -f $RemoteDistributor ) - $serverObject = Connect-SqlDscDatabaseEngine -InstanceName $ReplicationServer.Name -ErrorAction 'Stop' + $serverObject = Connect-SqlDscDatabaseEngine -InstanceName $InstanceName -ErrorAction 'Stop' $sqlMajorVersion = $serverObject.VersionMajor From 8cce8bcf25f16ba215efe04cef8ae2af2e6d1724 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 26 Jan 2026 12:29:04 +0100 Subject: [PATCH 16/28] Add support for TrustServerCertificate in Connect-Sql and update localization strings --- .../Public/Connect-Sql.ps1 | 20 +++++++++++++++++++ .../en-US/SqlServerDsc.Common.strings.psd1 | 1 + 2 files changed, 21 insertions(+) diff --git a/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 b/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 index 2ecb5619e4..693e333f27 100644 --- a/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 +++ b/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 @@ -134,10 +134,30 @@ function Connect-Sql $sqlConnectionContext.ConnectTimeout = $StatementTimeout $sqlConnectionContext.ApplicationName = 'SqlServerDsc' + <# + SQL Server 2025 defaults to trust server certificate. + + TODO: We need a new parameter to control this behavior. Integration tests + DSC_SqlSecureConnection_AddSecureConnection_Config fails unless this is set. + #> + if ($sqlConnectionContext.PSObject.Properties.Name -contains 'TrustServerCertificate') + { + Write-Verbose -Message ( + $script:localizedData.IgnoreServerCertificateTrust + ) + + $sqlConnectionContext.TrustServerCertificate = $false + } + if ($Encrypt.IsPresent) { $sqlConnectionContext.EncryptConnection = $true } + else + { + # SQL Server 2025 defaults to having encryption enabled. + $sqlConnectionContext.EncryptConnection = $false + } if ($PSCmdlet.ParameterSetName -eq 'SqlServer') { diff --git a/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 b/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 index 6e1199905f..9f1285cc81 100644 --- a/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 +++ b/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 @@ -35,6 +35,7 @@ ConvertFrom-StringData @' ClusterLoginMissingRecommendedPermissions = The recommended account '{0}' is missing one or more of the following permissions: {1} (SQLCOMMON0052) ClusterLoginPermissionsPresent = The cluster login '{0}' has the required permissions. (SQLCOMMON0053) ConnectingUsingIntegrated = Connecting as current user '{0}' using integrated security. (SQLCOMMON0054) + IgnoreServerCertificateTrust = Ignoring server certificate trust; server certificate trust is not enforced when connecting. (SQLCOMMON0055) ConnectingUsingImpersonation = Impersonate credential '{0}' with login type '{1}'. (SQLCOMMON0056) ClusterResourceNotFoundOrOffline = The SQL Server cluster resource '{0}' was not found or the resource has been taken offline. (SQLCOMMON0066) NotOwnerOfClusterResource = The node '{0}' is not the owner of the cluster resource '{1}'. The owner is '{2}' so no restart is needed. (SQLCOMMON0067) From 8bf001c4b00e01ddef7aee5978f4e122a09b4296 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 26 Jan 2026 16:33:54 +0100 Subject: [PATCH 17/28] Add TrustServerCertificate property to Connect-SQL tests --- tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 index 0fe0a3836b..f325872c16 100644 --- a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 +++ b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 @@ -660,6 +660,8 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name ConnectAsUser -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ConnectAsUserPassword -Value '' -PassThru | Add-Member -MemberType NoteProperty -Name ConnectAsUserName -Value '' -PassThru | + Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | + Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | From 0ba017d3a183751e33e1dfd6327ccce1bb642e8d Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 26 Jan 2026 17:28:40 +0100 Subject: [PATCH 18/28] Add TrustServerCertificate property to Connect-SQL tests --- tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 index f325872c16..10ad6519cb 100644 --- a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 +++ b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 @@ -613,6 +613,8 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name ConnectAsUser -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ConnectAsUserPassword -Value '' -PassThru | Add-Member -MemberType NoteProperty -Name ConnectAsUserName -Value '' -PassThru | + Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | + Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | From c6148bb488ddf98b03ddfea5a19c5a7c751121a8 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 26 Jan 2026 18:58:25 +0100 Subject: [PATCH 19/28] Add TrustServerCertificate property to Connect-SQL tests --- tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 index 10ad6519cb..6cff4e2d25 100644 --- a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 +++ b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 @@ -107,6 +107,7 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | + Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true @@ -450,6 +451,7 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | + Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true @@ -510,6 +512,7 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | + Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true @@ -570,6 +573,7 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | + Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true From b50c5ca511a51f5e7535ad6a927215e299742c35 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 12:14:37 +0100 Subject: [PATCH 20/28] Refactor Connect-Sql to handle TrustServerCertificate logic and enhance certificate import in New-SQLSelfSignedCertificate --- .../Public/Connect-Sql.ps1 | 30 +++++++++---------- tests/TestHelpers/CommonTestHelper.psm1 | 11 +++++++ 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 b/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 index 693e333f27..d9e200cc2a 100644 --- a/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 +++ b/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 @@ -134,21 +134,6 @@ function Connect-Sql $sqlConnectionContext.ConnectTimeout = $StatementTimeout $sqlConnectionContext.ApplicationName = 'SqlServerDsc' - <# - SQL Server 2025 defaults to trust server certificate. - - TODO: We need a new parameter to control this behavior. Integration tests - DSC_SqlSecureConnection_AddSecureConnection_Config fails unless this is set. - #> - if ($sqlConnectionContext.PSObject.Properties.Name -contains 'TrustServerCertificate') - { - Write-Verbose -Message ( - $script:localizedData.IgnoreServerCertificateTrust - ) - - $sqlConnectionContext.TrustServerCertificate = $false - } - if ($Encrypt.IsPresent) { $sqlConnectionContext.EncryptConnection = $true @@ -157,6 +142,21 @@ function Connect-Sql { # SQL Server 2025 defaults to having encryption enabled. $sqlConnectionContext.EncryptConnection = $false + + <# + SQL Server 2025 defaults to trust server certificate. + + TODO: We need a new parameter to control this behavior. Integration tests + DSC_SqlSecureConnection_AddSecureConnection_Config fails unless this is set. + #> + if ($sqlConnectionContext.PSObject.Properties.Name -contains 'TrustServerCertificate') + { + Write-Verbose -Message ( + $script:localizedData.IgnoreServerCertificateTrust + ) + + $sqlConnectionContext.TrustServerCertificate = $false + } } if ($PSCmdlet.ParameterSetName -eq 'SqlServer') diff --git a/tests/TestHelpers/CommonTestHelper.psm1 b/tests/TestHelpers/CommonTestHelper.psm1 index 36556c570d..c0cb7effe7 100644 --- a/tests/TestHelpers/CommonTestHelper.psm1 +++ b/tests/TestHelpers/CommonTestHelper.psm1 @@ -323,6 +323,17 @@ function New-SQLSelfSignedCertificate $env:SqlCertificateThumbprint = $certificate.Thumbprint Write-Verbose -Message ('Session environment variable $env:SqlCertificateThumbprint set to ''{0}''' -f $env:SqlCertificateThumbprint) + # Import the created certificate into the Local Machine Trusted Root store + try + { + Import-PfxCertificate -FilePath $sqlPrivateCertificatePath -Password $sqlPrivateKeyPassword -CertStoreLocation 'Cert:\LocalMachine\Root' -ErrorAction Stop | Out-Null + Write-Verbose -Message ('Imported certificate into Cert:\\LocalMachine\\Root with thumbprint ''{0}''.' -f $certificate.Thumbprint) + } + catch + { + Write-Warning -Message ('Failed to import certificate into trusted root store: {0}' -f $_.Exception.Message) + } + return $certificate } From 951df130292ed0670dc0233cf840aeda17f647c5 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 15:38:04 +0100 Subject: [PATCH 21/28] Remove default encryption handling for SQL Server 2025 in Connect-Sql function --- .../Public/Connect-Sql.ps1 | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 b/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 index d9e200cc2a..2ecb5619e4 100644 --- a/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 +++ b/source/Modules/SqlServerDsc.Common/Public/Connect-Sql.ps1 @@ -138,26 +138,6 @@ function Connect-Sql { $sqlConnectionContext.EncryptConnection = $true } - else - { - # SQL Server 2025 defaults to having encryption enabled. - $sqlConnectionContext.EncryptConnection = $false - - <# - SQL Server 2025 defaults to trust server certificate. - - TODO: We need a new parameter to control this behavior. Integration tests - DSC_SqlSecureConnection_AddSecureConnection_Config fails unless this is set. - #> - if ($sqlConnectionContext.PSObject.Properties.Name -contains 'TrustServerCertificate') - { - Write-Verbose -Message ( - $script:localizedData.IgnoreServerCertificateTrust - ) - - $sqlConnectionContext.TrustServerCertificate = $false - } - } if ($PSCmdlet.ParameterSetName -eq 'SqlServer') { From cb4e1596a5febaa0847fe60c7f43699fdc6f6373 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 15:38:18 +0100 Subject: [PATCH 22/28] Remove SQL Server 2025 tag from integration test description --- .../Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 index b6b7838b46..44b7a93c38 100644 --- a/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 @@ -64,7 +64,7 @@ AfterAll { Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force } -Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') { +Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { # 'Integration_SQL2025' BeforeAll { $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test" } From e7883e2f251f974816f48681917a79ba546365f8 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 15:45:12 +0100 Subject: [PATCH 23/28] Remove obsolete TLS protocol handling functions and related tests --- .../ConvertTo-TlsProtocolRegistryKeyName.ps1 | 73 -------- .../Private/Get-TlsProtocolRegistryPath.ps1 | 54 ------ .../Get-TlsProtocolTargetRegistryName.ps1 | 43 ----- source/Public/Test-TlsProtocol.ps1 | 117 ------------ ...ertTo-TlsProtocolRegistryKeyName.Tests.ps1 | 89 ---------- .../Get-TlsProtocolRegistryPath.Tests.ps1 | 72 -------- ...et-TlsProtocolTargetRegistryName.Tests.ps1 | 59 ------- tests/Unit/Public/Test-TlsProtocol.Tests.ps1 | 167 ------------------ 8 files changed, 674 deletions(-) delete mode 100644 source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 delete mode 100644 source/Private/Get-TlsProtocolRegistryPath.ps1 delete mode 100644 source/Private/Get-TlsProtocolTargetRegistryName.ps1 delete mode 100644 source/Public/Test-TlsProtocol.ps1 delete mode 100644 tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 delete mode 100644 tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 delete mode 100644 tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 delete mode 100644 tests/Unit/Public/Test-TlsProtocol.Tests.ps1 diff --git a/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 b/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 deleted file mode 100644 index ca049a2705..0000000000 --- a/source/Private/ConvertTo-TlsProtocolRegistryKeyName.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -<# - .SYNOPSIS - Converts a friendly protocol identifier to the SCHANNEL registry key name. - - .DESCRIPTION - Maps user-friendly protocol names accepted by the public commands - (e.g. Tls12) to the actual SCHANNEL registry key names (e.g. 'TLS 1.2'). - - .PARAMETER Protocol - The protocol identifier, e.g. 'Tls12', 'Ssl3', 'Tls'. - - .OUTPUTS - System.String - - .EXAMPLE - ConvertTo-TlsProtocolRegistryKeyName -Protocol Tls12 - - Returns the string 'TLS 1.2'. -#> -function ConvertTo-TlsProtocolRegistryKeyName -{ - [CmdletBinding()] - [OutputType([System.String])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $Protocol - ) - - $protocolRegistryKeyName = switch ($Protocol.ToLower()) - { - 'ssl2' - { - 'SSL 2.0' - } - - 'ssl3' - { - 'SSL 3.0' - } - - 'tls' - { - 'TLS 1.0' - } - - 'tls11' - { - 'TLS 1.1' - } - - 'tls12' - { - 'TLS 1.2' - } - - 'tls13' - { - 'TLS 1.3' - } - - default - { - $message = "Unknown protocol '$Protocol'. Valid values: Ssl2, Ssl3, Tls, Tls11, Tls12, Tls13." - $exception = New-Exception -Message $message - $errorRecord = New-ErrorRecord -Exception $exception -ErrorId 'InvalidProtocol' -ErrorCategory ([System.Management.Automation.ErrorCategory]::InvalidArgument) -TargetObject $Protocol - $PSCmdlet.ThrowTerminatingError($errorRecord) - } - } - - return $protocolRegistryKeyName -} diff --git a/source/Private/Get-TlsProtocolRegistryPath.ps1 b/source/Private/Get-TlsProtocolRegistryPath.ps1 deleted file mode 100644 index 05a027f4a3..0000000000 --- a/source/Private/Get-TlsProtocolRegistryPath.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -<# - .SYNOPSIS - Returns the SCHANNEL registry path for a given protocol and target. - - .DESCRIPTION - Builds the registry path under - HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols - for the provided friendly protocol name and selects the `Server` or - `Client` subkey depending on the `-Client` switch. - - .PARAMETER Protocol - The protocol identifier, e.g. 'Tls12'. - - .PARAMETER Client - When specified, return the path for the `Client` subkey, otherwise - return the `Server` subkey path. - - .OUTPUTS - System.String - - .EXAMPLE - Get-TlsProtocolRegistryPath -Protocol Tls12 - - Returns the string: - 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server'. - - .EXAMPLE - Get-TlsProtocolRegistryPath -Protocol Tls13 -Client - - Returns the string: - 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client'. -#> -function Get-TlsProtocolRegistryPath -{ - [CmdletBinding()] - [OutputType([System.String])] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Protocol, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Client - ) - - $protocolKeyName = ConvertTo-TlsProtocolRegistryKeyName -Protocol $Protocol - - $target = Get-TlsProtocolTargetRegistryName -Client:$Client - - return "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\$protocolKeyName\\$target" -} diff --git a/source/Private/Get-TlsProtocolTargetRegistryName.ps1 b/source/Private/Get-TlsProtocolTargetRegistryName.ps1 deleted file mode 100644 index cafb04cfda..0000000000 --- a/source/Private/Get-TlsProtocolTargetRegistryName.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -<# - .SYNOPSIS - Returns the SCHANNEL protocol target name for registry keys. - - .DESCRIPTION - Returns either 'Server' or 'Client' depending on the provided - `-Client` switch. This centralizes the logic used by public commands - for choosing the registry subkey name. - - .PARAMETER Client - When specified, return 'Client', otherwise return 'Server'. - - .OUTPUTS - System.String - - .EXAMPLE - Get-TlsProtocolTargetRegistryName - - Returns the string 'Server'. - - .EXAMPLE - Get-TlsProtocolTargetRegistryName -Client - - Returns the string 'Client'. -#> -function Get-TlsProtocolTargetRegistryName -{ - [CmdletBinding()] - [OutputType([System.String])] - param - ( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Client - ) - - if ($Client.IsPresent) - { - return 'Client' - } - - return 'Server' -} diff --git a/source/Public/Test-TlsProtocol.ps1 b/source/Public/Test-TlsProtocol.ps1 deleted file mode 100644 index 75b58e3d8f..0000000000 --- a/source/Public/Test-TlsProtocol.ps1 +++ /dev/null @@ -1,117 +0,0 @@ -<# - .SYNOPSIS - Tests if specified TLS/SSL protocols are enabled on the local machine. - - .DESCRIPTION - Tests one or more SCHANNEL protocol keys under - HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols - to determine whether the protocol is enabled for server-side connections. - - .PARAMETER Protocol - One or more protocol names to check. Valid values: Ssl2, Ssl3, Tls, Tls11, Tls12, Tls13. - - .PARAMETER Client - When specified, will check the protocol `Client` registry - key instead of the default `Server` key. - - .PARAMETER Disabled - When specified, test that the protocol(s) are disabled. By default the - command tests that the protocol(s) are enabled. - - .OUTPUTS - System.Boolean - - .EXAMPLE - Test-TlsProtocol -Protocol Tls12 - - Tests if TLS 1.2 is enabled for server-side connections. - - .EXAMPLE - Test-TlsProtocol -Protocol Tls13 -Client - - Tests if TLS 1.3 is enabled for client-side connections. -#> -function Test-TlsProtocol -{ - [CmdletBinding()] - [OutputType([System.Boolean])] - param - ( - # TODO: Should use enum [System.Security.Authentication.SslProtocols] - [Parameter(Mandatory = $true)] - [ValidateSet('Ssl2', 'Ssl3', 'Tls', 'Tls11', 'Tls12', 'Tls13', IgnoreCase = $true)] - [System.String[]] - $Protocol, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Client, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Disabled - ) - - foreach ($p in $Protocol) - { - $regPath = Get-TlsProtocolRegistryPath -Protocol $p -Client:$Client - - $protocolEnabled = Get-RegistryPropertyValue -Path $regPath -Name 'Enabled' -ErrorAction SilentlyContinue - $protocolDisabled = Get-RegistryPropertyValue -Path $regPath -Name 'DisabledByDefault' -ErrorAction SilentlyContinue - - $protocolEnabled = if ($null -ne $protocolEnabled) - { - [System.Int32] $protocolEnabled - } - else - { - $null - } - - $protocolDisabled = if ($null -ne $protocolDisabled) - { - [System.Int32] $protocolDisabled - } - else - { - $null - } - - if ($Disabled.IsPresent) - { - # Consider protocol enabled when both Enabled and DisabledByDefault are missing - if ($null -eq $protocolEnabled -and $null -eq $protocolDisabled) - { - return $false - } - - # Consider protocol disabled when Enabled != 1 or DisabledByDefault == 1 - if (($null -ne $protocolEnabled -and $protocolEnabled -ne 1) -or ($null -ne $protocolDisabled -and $protocolDisabled -eq 1)) - { - continue - } - else - { - return $false - } - } - else - { - if ($null -eq $protocolEnabled -and $null -eq $protocolDisabled) - { - continue - } - - if ($protocolEnabled -eq 1 -and $protocolDisabled -ne 1) - { - continue - } - else - { - return $false - } - } - } - - return $true -} diff --git a/tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 b/tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 deleted file mode 100644 index d93587aeeb..0000000000 --- a/tests/Unit/Private/ConvertTo-TlsProtocolRegistryKeyName.Tests.ps1 +++ /dev/null @@ -1,89 +0,0 @@ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] -param () - -BeforeDiscovery { - try - { - if (-not (Get-Module -Name 'DscResource.Test')) - { - if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) - { - & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null - } - - Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' - } - } - catch [System.IO.FileNotFoundException] - { - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' - } -} - -BeforeAll { - $script:moduleName = 'SqlServerDsc' - - $env:SqlServerDscCI = $true - - Import-Module -Name $script:moduleName -ErrorAction 'Stop' - - $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName -} - -AfterAll { - $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') - $PSDefaultParameterValues.Remove('Mock:ModuleName') - $PSDefaultParameterValues.Remove('Should:ModuleName') - - Remove-Item -Path 'env:SqlServerDscCI' -} - -Describe 'ConvertTo-TlsProtocolRegistryKeyName' -Tag 'Private' { - Context 'When converting known friendly protocol names' { - It 'Maps Tls12 to TLS 1.2' { - InModuleScope -ScriptBlock { - ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls12' | Should -Be 'TLS 1.2' - } - } - - It 'Maps Tls11 to TLS 1.1' { - InModuleScope -ScriptBlock { - ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls11' | Should -Be 'TLS 1.1' - } - } - - It 'Maps Tls to TLS 1.0' { - InModuleScope -ScriptBlock { - ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls' | Should -Be 'TLS 1.0' - } - } - - It 'Maps Ssl3 to SSL 3.0' { - InModuleScope -ScriptBlock { - ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Ssl3' | Should -Be 'SSL 3.0' - } - } - - It 'Maps Ssl2 to SSL 2.0' { - InModuleScope -ScriptBlock { - ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Ssl2' | Should -Be 'SSL 2.0' - } - } - - It 'Maps Tls13 to TLS 1.3' { - InModuleScope -ScriptBlock { - ConvertTo-TlsProtocolRegistryKeyName -Protocol 'Tls13' | Should -Be 'TLS 1.3' - } - } - } - - Context 'When given an unknown protocol' { - It 'Should throw a terminating error' { - InModuleScope -ScriptBlock { - { ConvertTo-TlsProtocolRegistryKeyName -Protocol 'NoSuchProto' } | Should -Throw -ErrorId 'InvalidProtocol,ConvertTo-TlsProtocolRegistryKeyName' - } - } - } -} diff --git a/tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 b/tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 deleted file mode 100644 index 78c609b58f..0000000000 --- a/tests/Unit/Private/Get-TlsProtocolRegistryPath.Tests.ps1 +++ /dev/null @@ -1,72 +0,0 @@ - -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] -param () - -BeforeDiscovery { - try - { - if (-not (Get-Module -Name 'DscResource.Test')) - { - if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) - { - & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null - } - - Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' - } - } - catch [System.IO.FileNotFoundException] - { - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' - } -} - -BeforeAll { - $script:moduleName = 'SqlServerDsc' - - $env:SqlServerDscCI = $true - - Import-Module -Name $script:moduleName -ErrorAction 'Stop' - - $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName -} - -AfterAll { - $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') - $PSDefaultParameterValues.Remove('Mock:ModuleName') - $PSDefaultParameterValues.Remove('Should:ModuleName') - - Remove-Item -Path 'env:SqlServerDscCI' -} - -Describe 'Get-TlsProtocolRegistryPath' -Tag 'Private' { - Context 'When building the registry path for Server' { - It 'returns server registry path for Tls12 by default' { - InModuleScope -ScriptBlock { - Mock -CommandName ConvertTo-TlsProtocolRegistryKeyName -MockWith { 'Tls12' } - Mock -CommandName Get-TlsProtocolTargetRegistryName -MockWith { 'Server' } - - $result = Get-TlsProtocolRegistryPath -Protocol 'Tls12' - - $expected = 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\Tls12\\Server' - $result | Should -Be $expected - } - } - } - - Context 'When building the registry path for Client' { - It 'returns client registry path when -Client is specified' { - InModuleScope -ScriptBlock { - Mock -CommandName ConvertTo-TlsProtocolRegistryKeyName -MockWith { 'Tls12' } - Mock -CommandName Get-TlsProtocolTargetRegistryName -MockWith { 'Client' } - - $result = Get-TlsProtocolRegistryPath -Protocol 'Tls12' -Client - - $expected = 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\Tls12\\Client' - $result | Should -Be $expected - } - } - } -} diff --git a/tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 b/tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 deleted file mode 100644 index 732d015d15..0000000000 --- a/tests/Unit/Private/Get-TlsProtocolTargetRegistryName.Tests.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] -param () - -BeforeDiscovery { - try - { - if (-not (Get-Module -Name 'DscResource.Test')) - { - if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) - { - & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null - } - - Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' - } - } - catch [System.IO.FileNotFoundException] - { - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' - } -} - -BeforeAll { - $script:moduleName = 'SqlServerDsc' - - $env:SqlServerDscCI = $true - - Import-Module -Name $script:moduleName -ErrorAction 'Stop' - - $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName -} - -AfterAll { - $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') - $PSDefaultParameterValues.Remove('Mock:ModuleName') - $PSDefaultParameterValues.Remove('Should:ModuleName') - - Remove-Item -Path 'env:SqlServerDscCI' -} - -Describe 'Get-TlsProtocolTargetRegistryName' -Tag 'Private' { - Context 'When Client switch is present' { - It 'returns Client' { - InModuleScope -ScriptBlock { - (Get-TlsProtocolTargetRegistryName -Client) | Should -Be 'Client' - } - } - } - - Context 'When Client switch is not present' { - It 'returns Server' { - InModuleScope -ScriptBlock { - (Get-TlsProtocolTargetRegistryName) | Should -Be 'Server' - } - } - } -} diff --git a/tests/Unit/Public/Test-TlsProtocol.Tests.ps1 b/tests/Unit/Public/Test-TlsProtocol.Tests.ps1 deleted file mode 100644 index 27d68cdc21..0000000000 --- a/tests/Unit/Public/Test-TlsProtocol.Tests.ps1 +++ /dev/null @@ -1,167 +0,0 @@ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')] -param () - -BeforeDiscovery { - try - { - if (-not (Get-Module -Name 'DscResource.Test')) - { - if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable)) - { - & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null - } - - Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop' - } - } - catch [System.IO.FileNotFoundException] - { - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.' - } -} - -BeforeAll { - $script:moduleName = 'SqlServerDsc' - - $env:SqlServerDscCI = $true - - Import-Module -Name $script:moduleName -ErrorAction 'Stop' - - $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName - $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName -} - -AfterAll { - $PSDefaultParameterValues.Remove('InModuleScope:ModuleName') - $PSDefaultParameterValues.Remove('Mock:ModuleName') - $PSDefaultParameterValues.Remove('Should:ModuleName') - - Remove-Item -Path 'env:SqlServerDscCI' -} - -Describe 'Test-TlsProtocol' -Tag 'Public' { - Context 'When protocol is enabled in registry' { - BeforeAll { - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 1 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } - - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 0 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } - } - - It 'Should return $true' { - $result = Test-TlsProtocol -Protocol 'Tls12' - - $result | Should -BeTrue - } - } - - Context 'When protocol key is missing' { - BeforeAll { - Mock -CommandName Get-RegistryPropertyValue - } - - It 'Should return $true' { - $result = Test-TlsProtocol -Protocol 'Tls12' - - $result | Should -BeTrue - } - } - - Context 'When DisabledByDefault is set to 1' { - BeforeAll { - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 1 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } - - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 1 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } - } - - It 'Should return $false when DisabledByDefault is 1' { - $result = Test-TlsProtocol -Protocol 'Tls12' - - $result | Should -BeFalse - } - } - - Context 'When using the Client switch' { - BeforeAll { - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 1 - } -ParameterFilter { $Path -like '*\\Client' -and $Name -eq 'Enabled' } - - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 0 - } -ParameterFilter { $Path -like '*\\Client' -and $Name -eq 'DisabledByDefault' } - } - - It 'Should check the Client registry key' { - $result = Test-TlsProtocol -Protocol 'Tls12' -Client - - $result | Should -BeTrue - - Should -Invoke -CommandName Get-RegistryPropertyValue -ParameterFilter { - $Path -like '*\\Client' -and $Name -eq 'Enabled' - } -Exactly -Times 1 -Scope It - - Should -Invoke -CommandName Get-RegistryPropertyValue -ParameterFilter { - $Path -like '*\\Client' -and $Name -eq 'DisabledByDefault' - } -Exactly -Times 1 -Scope It - } - } - - Context 'When testing for Disabled protocols' { - Context 'When protocol is explicitly disabled' { - BeforeAll { - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 0 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } - - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 1 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } - } - - It 'Should return $true for -Disabled' { - $result = Test-TlsProtocol -Protocol 'Tls12' -Disabled - - $result | Should -BeTrue - } - } - - Context 'When protocol is enabled' { - BeforeAll { - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 1 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'Enabled' } - - Mock -CommandName Get-RegistryPropertyValue -MockWith { - return 0 - } -ParameterFilter { $Path -like '*\\Server' -and $Name -eq 'DisabledByDefault' } - } - - It 'Should return $false for -Disabled' { - $result = Test-TlsProtocol -Protocol 'Tls12' -Disabled - - $result | Should -BeFalse - } - } - - Context 'When protocol key is missing' { - BeforeAll { - Mock -CommandName Get-RegistryPropertyValue - } - - It 'Should treat missing keys as enabled for -Disabled' { - $result = Test-TlsProtocol -Protocol 'Tls12' -Disabled - - $result | Should -BeFalse - } - } - } -} From 9f8fc186beb29a53e41ec0d1e8b917f36d2ea11e Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 15:45:20 +0100 Subject: [PATCH 24/28] Skip TLS 1.2 enabled test for SQL Server 2025 integration due to installation issues --- tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 index 9c92008a1c..7eb1847564 100644 --- a/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 +++ b/tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1 @@ -255,7 +255,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', } } - Context 'Ensure TLS 1.2 is enabled' -Tag @('Integration_SQL2025') { + Context 'Ensure TLS 1.2 is enabled' -Tag @('Integration_SQL2025') -Skip { # SQL Server 2025 installation can fail when TLS 1.2 is disabled: # https://learn.microsoft.com/en-us/sql/sql-server/sql-server-2025-known-issues?view=sql-server-ver17#sql-server-2025-installation-fails-when-tls-12-is-disabled It 'Should have TLS 1.2 enabled on the node' -Tag @('Integration_SQL2025') { From 3334285937137251d6a24810247923118051459b Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 15:51:01 +0100 Subject: [PATCH 25/28] Remove obsolete message for ignoring server certificate trust in SqlServerDsc.Common strings --- .../SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 | 1 - 1 file changed, 1 deletion(-) diff --git a/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 b/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 index 9f1285cc81..6e1199905f 100644 --- a/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 +++ b/source/Modules/SqlServerDsc.Common/en-US/SqlServerDsc.Common.strings.psd1 @@ -35,7 +35,6 @@ ConvertFrom-StringData @' ClusterLoginMissingRecommendedPermissions = The recommended account '{0}' is missing one or more of the following permissions: {1} (SQLCOMMON0052) ClusterLoginPermissionsPresent = The cluster login '{0}' has the required permissions. (SQLCOMMON0053) ConnectingUsingIntegrated = Connecting as current user '{0}' using integrated security. (SQLCOMMON0054) - IgnoreServerCertificateTrust = Ignoring server certificate trust; server certificate trust is not enforced when connecting. (SQLCOMMON0055) ConnectingUsingImpersonation = Impersonate credential '{0}' with login type '{1}'. (SQLCOMMON0056) ClusterResourceNotFoundOrOffline = The SQL Server cluster resource '{0}' was not found or the resource has been taken offline. (SQLCOMMON0066) NotOwnerOfClusterResource = The node '{0}' is not the owner of the cluster resource '{1}'. The owner is '{2}' so no restart is needed. (SQLCOMMON0067) From a34ab256c69c4721c9aeb8e5f3961f962d821e00 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 15:52:22 +0100 Subject: [PATCH 26/28] Remove TrustServerCertificate property from Connect-SQL tests --- tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 index 6cff4e2d25..38d5c5b6af 100644 --- a/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 +++ b/tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 @@ -107,7 +107,6 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | - Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true @@ -451,7 +450,6 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | - Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true @@ -512,7 +510,6 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | - Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true @@ -573,7 +570,6 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | - Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | Add-Member -MemberType ScriptMethod -Name Disconnect -Value { return $true @@ -618,7 +614,6 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name ConnectAsUserPassword -Value '' -PassThru | Add-Member -MemberType NoteProperty -Name ConnectAsUserName -Value '' -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | - Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | @@ -667,7 +662,6 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' { Add-Member -MemberType NoteProperty -Name ConnectAsUserPassword -Value '' -PassThru | Add-Member -MemberType NoteProperty -Name ConnectAsUserName -Value '' -PassThru | Add-Member -MemberType NoteProperty -Name EncryptConnection -Value $false -PassThru | - Add-Member -MemberType NoteProperty -Name TrustServerCertificate -Value $false -PassThru | Add-Member -MemberType NoteProperty -Name StatementTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ConnectTimeout -Value 600 -PassThru | Add-Member -MemberType NoteProperty -Name ApplicationName -Value 'SqlServerDsc' -PassThru | From d139158e45f700e74b5f21abe35b4e47177e4b21 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 17:00:08 +0100 Subject: [PATCH 27/28] Skip TLS 1.2 enabled test for SQL Server 2025 integration due to installation issues --- tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 index 83cff34fff..06d36b2520 100644 --- a/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 +++ b/tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 @@ -269,7 +269,7 @@ Describe 'Prerequisites' { } } - Context 'Ensure TLS 1.2 is enabled' -Tag @('Integration_SQL2025') { + Context 'Ensure TLS 1.2 is enabled' -Tag @('Integration_SQL2025') -Skip { # SQL Server 2025 installation can fail when TLS 1.2 is disabled: # https://learn.microsoft.com/en-us/sql/sql-server/sql-server-2025-known-issues?view=sql-server-ver17#sql-server-2025-installation-fails-when-tls-12-is-disabled It 'Should have TLS 1.2 enabled on the node' -Tag @('Integration_SQL2025') { From aa49742c034026e7f1f8e3547caf5fbc3d3bb690 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 27 Jan 2026 21:12:43 +0100 Subject: [PATCH 28/28] Enhance CompatibilityLevel handling for SQL Server 2025 by converting numeric values to 'Version' prefixed format --- source/Classes/020.SqlDatabase.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/Classes/020.SqlDatabase.ps1 b/source/Classes/020.SqlDatabase.ps1 index 8c653632f2..cb6364ea71 100644 --- a/source/Classes/020.SqlDatabase.ps1 +++ b/source/Classes/020.SqlDatabase.ps1 @@ -745,7 +745,21 @@ class SqlDatabase : SqlResourceBase # Only set CompatibilityLevel if it's a valid non-zero value if ($databaseObject.CompatibilityLevel -gt 0) { - $currentState.CompatibilityLevel = $databaseObject.CompatibilityLevel.ToString() + $compatValue = $databaseObject.CompatibilityLevel.ToString() + + <# + SMO may return numeric values (e.g. 170 for SQL Server 2025). + Convert purely-numeric values to the 'Version' prefixed form + so they match the ValidateSet values (Version80..Version170). + #> + if ($compatValue -match '^[0-9]+$') + { + $currentState.CompatibilityLevel = 'Version{0}' -f $compatValue + } + else + { + $currentState.CompatibilityLevel = $compatValue + } } $currentState.RecoveryModel = $databaseObject.RecoveryModel.ToString()