Skip to content

Commit 2b67c1b

Browse files
Copilotjohlju
andcommitted
Re-add ReportServerEdition enum to SqlRSSetup class
Co-authored-by: johlju <7189721+johlju@users.noreply.github.com>
1 parent 1a6a9f7 commit 2b67c1b

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

source/Classes/020.SqlRSSetup.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ class SqlRSSetup : ResourceBase
187187
$EditionUpgrade
188188

189189
[DscProperty()]
190-
[ValidateSet('Developer', 'Evaluation', 'ExpressAdvanced')]
191-
[System.String]
190+
[ReportServerEdition]
192191
$Edition
193192

194193
[DscProperty()]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<#
2+
.SYNOPSIS
3+
The possible states for the commands and DSC resources that handles
4+
SQL Server Reporting Services or Power BI Report Server and uses the
5+
parameter Edition.
6+
#>
7+
enum ReportServerEdition
8+
{
9+
Developer = 1
10+
Evaluation
11+
ExpressAdvanced
12+
}

tests/Unit/Classes/SqlRSSetup.Tests.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ Describe 'SqlRSSetup\Get()' -Tag 'Get' {
129129
$currentState.MediaPath | Should -BeNullOrEmpty
130130
$currentState.ProductKey | Should -BeNullOrEmpty
131131
$currentState.EditionUpgrade | Should -BeNullOrEmpty
132-
$currentState.Edition | Should -BeNullOrEmpty
132+
# Returns 0, that means no value was set by GetCurrentState() from the enum ReportServerEdition
133+
$currentState.Edition | Should -Be 0
133134
$currentState.LogPath | Should -BeNullOrEmpty
134135
$currentState.InstallFolder | Should -BeNullOrEmpty
135136
$currentState.SuppressRestart | Should -BeFalse
@@ -187,7 +188,8 @@ Describe 'SqlRSSetup\Get()' -Tag 'Get' {
187188
$currentState.MediaPath | Should -BeNullOrEmpty
188189
$currentState.ProductKey | Should -BeNullOrEmpty
189190
$currentState.EditionUpgrade | Should -BeNullOrEmpty
190-
$currentState.Edition | Should -BeNullOrEmpty
191+
# Returns 0, that means no value was set by GetCurrentState() from the enum ReportServerEdition
192+
$currentState.Edition | Should -Be 0
191193
$currentState.LogPath | Should -BeNullOrEmpty
192194
$currentState.InstallFolder | Should -BeNullOrEmpty
193195
$currentState.SuppressRestart | Should -BeFalse

0 commit comments

Comments
 (0)