From ed2f01850c1d32f491339918e8478e81b103d352 Mon Sep 17 00:00:00 2001 From: ruandersMSFT Date: Thu, 1 Jun 2023 11:07:55 -0600 Subject: [PATCH] Fix Build to backup/restore valid STIG Definitions --- Tests/Unit/Module/STIG.BackupRevert.tests.ps1 | 8 ++++---- source/Module/STIG/Functions.BackupRevert.ps1 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/Unit/Module/STIG.BackupRevert.tests.ps1 b/Tests/Unit/Module/STIG.BackupRevert.tests.ps1 index 6c77d2b8..fd3f1ff9 100644 --- a/Tests/Unit/Module/STIG.BackupRevert.tests.ps1 +++ b/Tests/Unit/Module/STIG.BackupRevert.tests.ps1 @@ -15,11 +15,11 @@ Describe 'Backup-StigSettings' { } It 'Should not throw WindowsClient' { - {Backup-StigSettings -StigName "WindowsClient-10-2.2.xml"} | Should -not -Throw + {Backup-StigSettings -StigName "WindowsClient-10-2.5.xml"} | Should -not -Throw } It 'Should not throw Sql Server 2016' { - {Backup-StigSettings -StigName "SqlServer-2016-Instance-2.3.xml"} | Should -not -Throw + {Backup-StigSettings -StigName "SqlServer-2016-Instance-2.8.xml"} | Should -not -Throw } It 'Should return string with valid STIGs' { @@ -45,11 +45,11 @@ Describe 'Restore-StigSettings' { } It 'Should not throw for Client' { - {Restore-StigSettings -StigName "WindowsClient-10-2.2.xml" -Confirm:$false} | Should -Not -Throw + {Restore-StigSettings -StigName "WindowsClient-10-2.5.xml" -Confirm:$false} | Should -Not -Throw } It 'Should not throw for Sql Server 2016' { - {Restore-StigSettings -StigName "SqlServer-2016-Instance-2.3.xml" -Confirm:$false} | Should -Not -Throw + {Restore-StigSettings -StigName "SqlServer-2016-Instance-2.8.xml" -Confirm:$false} | Should -Not -Throw } } diff --git a/source/Module/STIG/Functions.BackupRevert.ps1 b/source/Module/STIG/Functions.BackupRevert.ps1 index ae14e3d3..3322d069 100644 --- a/source/Module/STIG/Functions.BackupRevert.ps1 +++ b/source/Module/STIG/Functions.BackupRevert.ps1 @@ -43,7 +43,7 @@ function Backup-StigSettings if ($validStigs.Name -notContains $StigName.Trim()) { $errorArray = $validStigs.Name -join("`n") - Write-Host "StigName not valid, options are :`n$errorArray" + Write-Host "StigName '$($StigName.Trim())' not valid, options are :`n$errorArray" break } @@ -429,7 +429,7 @@ function Restore-StigSettings if ($validStigs.Name -notContains $StigName.Trim()) { $errorArray = $validStigs.Name -join("`n") - Write-Host "StigName not valid, options are :`n$errorArray" + Write-Host "StigName '$($StigName.Trim())' not valid, options are :`n$errorArray" break }