Skip to content

Commit 395d894

Browse files
authored
Handle multi-line winget validate output in SandboxTest (#368912)
1 parent fbe9754 commit 395d894

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Tools/SandboxTest.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,11 @@ if (!$SkipManifestValidation -and ![String]::IsNullOrWhiteSpace($Manifest)) {
528528
Start-Sleep -Seconds 5 # Allow the user 5 seconds to read the warnings before moving on
529529
}
530530
default {
531-
Write-Information $validateCommandOutput.Trim() # On the success, print an empty line after the command output
531+
# Avoid writing a raw object array when `winget validate` returns multiple lines
532+
$validateSuccessOutput = @($validateCommandOutput).ForEach({ $_.ToString().Trim() }).Where({ -not [String]::IsNullOrWhiteSpace($_) })
533+
if ($validateSuccessOutput) {
534+
Write-Information ($validateSuccessOutput -join [Environment]::NewLine)
535+
}
532536
}
533537
}
534538
}

0 commit comments

Comments
 (0)