diff --git a/DSCResources/IisServer/IisServer.schema.psm1 b/DSCResources/IisServer/IisServer.schema.psm1 index 0acc9b3d..553d72a4 100644 --- a/DSCResources/IisServer/IisServer.schema.psm1 +++ b/DSCResources/IisServer/IisServer.schema.psm1 @@ -35,6 +35,11 @@ Configuration IisServer [string] $LogPath, + [Parameter()] + [ValidateNotNullOrEmpty()] + [version] + $IisVersion, + [Parameter()] [ValidateNotNullOrEmpty()] [version] @@ -62,7 +67,7 @@ Configuration IisServer ) ##### BEGIN DO NOT MODIFY ##### - $stig = [STIG]::New('IISServer', '8.5', $StigVersion) + $stig = [STIG]::New('IISServer', $IisVersion, $StigVersion) $stig.LoadRules($OrgSettings, $Exception, $SkipRule, $SkipRuleType) # $resourcePath is exported from the helper module in the header diff --git a/DSCResources/IisSite/IisSite.schema.psm1 b/DSCResources/IisSite/IisSite.schema.psm1 index 5c0dcf09..0365388b 100644 --- a/DSCResources/IisSite/IisSite.schema.psm1 +++ b/DSCResources/IisSite/IisSite.schema.psm1 @@ -42,6 +42,11 @@ Configuration IisSite [string[]] $WebAppPool, + [Parameter()] + [ValidateNotNullOrEmpty()] + [version] + $IisVersion, + [Parameter()] [ValidateNotNullOrEmpty()] [version] @@ -69,7 +74,7 @@ Configuration IisSite ) ##### BEGIN DO NOT MODIFY ##### - $stig = [STIG]::New('IISSite', '8.5', $StigVersion) + $stig = [STIG]::New('IISSite', $IisVersion, $StigVersion) $stig.LoadRules($OrgSettings, $Exception, $SkipRule, $SkipRuleType) # $resourcePath is exported from the helper module in the header diff --git a/DSCResources/Office/Office.schema.psm1 b/DSCResources/Office/Office.schema.psm1 index 972d4a78..50984662 100644 --- a/DSCResources/Office/Office.schema.psm1 +++ b/DSCResources/Office/Office.schema.psm1 @@ -32,7 +32,6 @@ Configuration Office param ( [Parameter(Mandatory = $true)] - [ValidateSet('Outlook2013', 'Excel2013', 'Word2013', 'PowerPoint2013')] [string] $OfficeApp, diff --git a/Module/STIG/STIG.psm1 b/Module/STIG/STIG.psm1 index 9c11429a..07ddf85b 100644 --- a/Module/STIG/STIG.psm1 +++ b/Module/STIG/STIG.psm1 @@ -207,8 +207,13 @@ Class STIG { [xml] $settings = Get-Content -Path $OrgSettings } - $settings.OrganizationalSettings.OrganizationalSetting | - Foreach-Object {$overRideValues[$_.Id] = $_.Value} + + # If there are no org settings to merge, skip over that + if($null -ne $settings.OrganizationalSettings.OrganizationalSetting) + { + $settings.OrganizationalSettings.OrganizationalSetting | + Foreach-Object {$overRideValues[$_.Id] = $_.Value} + } #endregion foreach ($type in $rules.DISASTIG.ChildNodes.GetEnumerator()) diff --git a/Tests/Integration/DSCResources/Common.integration.ps1 b/Tests/Integration/DSCResources/Common.integration.ps1 index 2a789e60..a4c89d56 100644 --- a/Tests/Integration/DSCResources/Common.integration.ps1 +++ b/Tests/Integration/DSCResources/Common.integration.ps1 @@ -7,7 +7,7 @@ Describe "$($stig.TechnologyRole) $($stig.StigVersion) mof output" { BrowserVersion = $stig.TechnologyRole StigVersion = $stig.StigVersion OutputPath = $TestDrive - OfficeApp = $stig.TechnologyRole + OfficeApp = $stig.TechnologyVersion ConfigPath = $configPath PropertiesPath = $propertiesPath OsVersion = $stig.TechnologyVersion diff --git a/Tests/Integration/DSCResources/DotNetFramework.integration.tests.ps1 b/Tests/Integration/DSCResources/DotNetFramework.integration.tests.ps1 index 7f44d5c9..885c20ba 100644 --- a/Tests/Integration/DSCResources/DotNetFramework.integration.tests.ps1 +++ b/Tests/Integration/DSCResources/DotNetFramework.integration.tests.ps1 @@ -14,12 +14,12 @@ try #region Integration Tests foreach ($stig in $stigList) { - Describe "Framework $($stig.TechnologyRole) $($stig.StigVersion) mof output" { + Describe "Framework $($stig.TechnologyVersion) $($stig.StigVersion) mof output" { It 'Should compile the MOF without throwing' { { & "$($script:DSCCompositeResourceName)_config" ` - -FrameworkVersion $stig.TechnologyRole ` + -FrameworkVersion $stig.TechnologyVersion ` -StigVersion $stig.StigVersion ` -OutputPath $TestDrive } | Should -Not -Throw diff --git a/Tests/Integration/DSCResources/IisServer.config.ps1 b/Tests/Integration/DSCResources/IisServer.config.ps1 index 31fa8433..34469e9f 100644 --- a/Tests/Integration/DSCResources/IisServer.config.ps1 +++ b/Tests/Integration/DSCResources/IisServer.config.ps1 @@ -94,7 +94,7 @@ Configuration IisServer_Config & ([scriptblock]::Create(" IisServer ServerConfiguration { - OsVersion = '$OsVersion' + IisVersion = '$OsVersion' StigVersion = '$StigVersion' LogPath = '$LogPath' $(if ($null -ne $OrgSettings) diff --git a/Tests/Integration/DSCResources/IisSite.config.ps1 b/Tests/Integration/DSCResources/IisSite.config.ps1 index 847fb496..ac723dd9 100644 --- a/Tests/Integration/DSCResources/IisSite.config.ps1 +++ b/Tests/Integration/DSCResources/IisSite.config.ps1 @@ -99,7 +99,7 @@ Configuration IisSite_config "WebAppPool = @($( ($WebAppPool | ForEach-Object {"'$PSItem'"}) -join ',' ))`n" }) $( "WebSiteName = @($( ($WebSiteName | ForEach-Object {"'$PSItem'"}) -join ',' ))`n" ) - OsVersion = '$OsVersion' + IisVersion = '$OsVersion' StigVersion = '$StigVersion' $(if ($null -ne $OrgSettings) { diff --git a/Tools/TestHelper/TestHelper.psm1 b/Tools/TestHelper/TestHelper.psm1 index 8ad093ff..b751c6f1 100644 --- a/Tools/TestHelper/TestHelper.psm1 +++ b/Tools/TestHelper/TestHelper.psm1 @@ -316,8 +316,6 @@ function Get-StigVersionTable $Filter ) - #$include = Import-PowerShellDataFile -Path $PSScriptRoot\CompositeResourceFilter.psd1 - $path = "$(Get-StigDataRootPath)\Processed" $versions = Get-ChildItem -Path $path -Exclude '*.org.*', '*.xsd', '*.md' -Include "$($CompositeResourceName)-*" -File -Recurse @@ -329,13 +327,24 @@ function Get-StigVersionTable { $stigDetails = $version.BaseName -Split "-" - $versionTable += @{ - 'Technology' = $stigDetails[0] + $currentVersion = @{ + 'Technology' = $stigDetails[0] 'TechnologyVersion' = $stigDetails[1] - 'TechnologyRole' = $stigDetails[2] - 'StigVersion' = $stigDetails[3] - 'Path' = $version.fullname - } + 'Path' = $version.fullname + } + + if ($stigDetails.count -eq 3) + { + $currentVersion.Add('TechnologyRole', '') + $currentVersion.Add('StigVersion', $stigDetails[2]) + } + elseif ($stigDetails.Count -eq 4) + { + $currentVersion.Add('TechnologyRole', $stigDetails[2]) + $currentVersion.Add('StigVersion', $stigDetails[3]) + } + + $versionTable += $currentVersion } }