Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/Classes/020.SqlRSSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ class SqlRSSetup : ResourceBase
$EditionUpgrade

[DscProperty()]
[ValidateSet('Developer', 'Evaluation', 'ExpressAdvanced')]
[System.String]
[ReportServerEdition]
$Edition

[DscProperty()]
Expand Down Expand Up @@ -402,8 +401,9 @@ class SqlRSSetup : ResourceBase
hidden [void] Modify([System.Collections.Hashtable] $properties)
{
$getDscPropertyParameters = @{
HasValue = $true
Attribute = @(
HasValue = $true
IgnoreZeroEnumValue = $true
Attribute = @(
'Optional'
'Mandatory'
)
Expand Down
12 changes: 12 additions & 0 deletions source/Enum/001.ReportServerEdition.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<#
.SYNOPSIS
The possible states for the commands and DSC resources that handles
SQL Server Reporting Services or Power BI Report Server and uses the
parameter Edition.
#>
enum ReportServerEdition
{
Developer = 1
Evaluation
ExpressAdvanced
}
6 changes: 4 additions & 2 deletions tests/Unit/Classes/SqlRSSetup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ Describe 'SqlRSSetup\Get()' -Tag 'Get' {
$currentState.MediaPath | Should -BeNullOrEmpty
$currentState.ProductKey | Should -BeNullOrEmpty
$currentState.EditionUpgrade | Should -BeNullOrEmpty
$currentState.Edition | Should -BeNullOrEmpty
# Returns 0, that means no value was set by GetCurrentState() from the enum ReportServerEdition
$currentState.Edition | Should -Be 0
$currentState.LogPath | Should -BeNullOrEmpty
$currentState.InstallFolder | Should -BeNullOrEmpty
$currentState.SuppressRestart | Should -BeFalse
Expand Down Expand Up @@ -187,7 +188,8 @@ Describe 'SqlRSSetup\Get()' -Tag 'Get' {
$currentState.MediaPath | Should -BeNullOrEmpty
$currentState.ProductKey | Should -BeNullOrEmpty
$currentState.EditionUpgrade | Should -BeNullOrEmpty
$currentState.Edition | Should -BeNullOrEmpty
# Returns 0, that means no value was set by GetCurrentState() from the enum ReportServerEdition
$currentState.Edition | Should -Be 0
$currentState.LogPath | Should -BeNullOrEmpty
$currentState.InstallFolder | Should -BeNullOrEmpty
$currentState.SuppressRestart | Should -BeFalse
Expand Down
Loading