diff --git a/CHANGELOG.md b/CHANGELOG.md index 82c04061d..fe820d58e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- SqlMaxDop + - Fixes ([issue #396](https://github.com/dsccommunity/SqlServerDsc/issues/396)). + Added three return values in Get-Target resource. + ## [15.0.0] - 2020-12-06 ### Added diff --git a/source/DSCResources/DSC_SqlMaxDop/DSC_SqlMaxDop.psm1 b/source/DSCResources/DSC_SqlMaxDop/DSC_SqlMaxDop.psm1 index 60c46fd38..6d58bad89 100644 --- a/source/DSCResources/DSC_SqlMaxDop/DSC_SqlMaxDop.psm1 +++ b/source/DSCResources/DSC_SqlMaxDop/DSC_SqlMaxDop.psm1 @@ -47,10 +47,13 @@ function Get-TargetResource } $returnValue = @{ - InstanceName = $InstanceName - ServerName = $ServerName - MaxDop = $currentMaxDop - IsActiveNode = $isActiveNode + InstanceName = $InstanceName + ServerName = $ServerName + MaxDop = $currentMaxDop + IsActiveNode = $isActiveNode + ProcessOnlyOnActiveNode = $null + Ensure = $null + DynamicAlloc = $null } $returnValue @@ -358,4 +361,3 @@ function Get-SqlDscDynamicMaxDop $dynamicMaxDop } -Export-ModuleMember -Function *-TargetResource diff --git a/tests/Unit/DSC_SqlMaxDop.Tests.ps1 b/tests/Unit/DSC_SqlMaxDop.Tests.ps1 index f55457243..a856c1bc2 100644 --- a/tests/Unit/DSC_SqlMaxDop.Tests.ps1 +++ b/tests/Unit/DSC_SqlMaxDop.Tests.ps1 @@ -125,6 +125,12 @@ try $result.InstanceName | Should -Be $testParameters.InstanceName } + It 'Should return $null for the remaining parameters' { + $result.ProcessOnlyOnActiveNode | Should -BeNullOrEmpty + $result.Ensure | Should -BeNullOrEmpty + $result.DynamicAlloc | Should -BeNullOrEmpty + } + It 'Should call the mock function Connect-SQL' { Assert-MockCalled -CommandName Connect-SQL -Exactly -Times 1 -Scope Context }