Skip to content

Commit 8d28ca6

Browse files
refactor: enhance error reporting for structure validation in Validate-Settings.ps1
1 parent d5712b2 commit 8d28ca6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/Validate-Settings.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ function Test-ObjectStructure {
9393
$structureErrors = Test-ObjectStructure -Actual $settings -Expected $expectedSettings
9494

9595
if ($structureErrors.Count -gt 0) {
96-
Write-Error "Structure validation failed with $($structureErrors.Count) error(s):"
97-
$structureErrors | ForEach-Object { Write-Error " - $_" }
96+
Write-Host ''
97+
Write-Host "Structure validation failed with $($structureErrors.Count) error(s):" -ForegroundColor Red
98+
$structureErrors | ForEach-Object { Write-Host " - $_" -ForegroundColor Red }
99+
Write-Error 'Settings structure does not match expected layout. See errors above.'
98100
exit 1
99101
}
100102

0 commit comments

Comments
 (0)