Repository navigation
Make console output compact and readable - #4
Conversation
The console now shows a header, named sections, one colored status line per package (OK, SKIP, WARN, FAIL) with aligned columns and short notes, transient progress bars, and a final result line with the exit code, any problems, the next step, and the log path. The log file keeps every step with timestamps, file names, and full error messages. The 64-bit relaunch no longer redirects the information stream, which split multi-color lines into fragments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
[Low impact] The changes affect console output for the LTSC installer and its relaunch path. The PR appears safe to merge, with non-blocking improvements needed for lost error details and progress cleanup.
|
| catch { Write-Host "[log write failed: $($_.Exception.Message)]" -ForegroundColor Yellow } | ||
| } | ||
| Write-Host $line | ||
| if ($Quiet) { return } |
There was a problem hiding this comment.
If neither log folder is writable, or writing fails during the run, Write-Log still drops messages marked -Quiet. Full deployment errors then disappear, leaving only the shortened console note from Format-Brief. Apply -Quiet only after the message was saved, and print the full message otherwise.
Prompt To Fix With AI
This is a comment left during a code review.
Path: install.ps1
Line: 191
Comment:
**Full error details disappear**
If neither log folder is writable, or writing fails during the run, `Write-Log` still drops messages marked `-Quiet`. Full deployment errors then disappear, leaving only the shortened console note from `Format-Brief`. Apply `-Quiet` only after the message was saved, and print the full message otherwise.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Valid. Fixed in 2f2d128: Write-Log hides -Quiet details and uses shortened -Console text only after the line was written to the log file. If there is no log file or the write fails, it prints the full message. Covered by tests/Test-ConsoleOutput.ps1.
| } | ||
| } | ||
| } | ||
| Show-Progress -Activity 'Downloading packages from Microsoft' -Completed |
There was a problem hiding this comment.
Failed runs leave progress active
The new progress bars are cleared only after their loops finish normally. A required catalog lookup or package download can throw before -Completed runs, leaving the bar active while the console shows the error. Clear the active bar in finally, including before an elevated window waits at the closing prompt.
Prompt To Fix With AI
This is a comment left during a code review.
Path: install.ps1
Line: 1196
Comment:
**Failed runs leave progress active**
The new progress bars are cleared only after their loops finish normally. A required catalog lookup or package download can throw before `-Completed` runs, leaving the bar active while the console shows the error. Clear the active bar in `finally`, including before an elevated window waits at the closing prompt.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Valid. Fixed in 2f2d128: Show-Progress now tracks open bars, and Clear-Progress closes them when a download fails, in the fatal-error handler, and at the start of Complete-Run. That covers every exit path, including the elevated window before its closing prompt. Covered by tests/Test-ConsoleOutput.ps1.
Write-Log hides -Quiet details and uses shortened -Console text only after the line was saved to the log file; otherwise it prints the full message. Show-Progress tracks open bars, and Clear-Progress closes them when a download fails, on a fatal error, and in Complete-Run, before the elevated window waits at its closing prompt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
The console printed about 150 timestamped lines on the LTSC 2024 VM run, usually 4–5 per package. It now prints about 35:
OK,SKIP,WARN, orFAIL. Columns are aligned, and short notes are dimmed (for example "version 8.2511.26001.0 already installed" or the download size).The log file is unchanged in detail. It keeps every step with timestamps, package file names, and full error messages, plus each console result line.
The 64-bit relaunch no longer uses
6>&1, which split multi-color lines into fragments. Colors are still lost on that path, but lines stay intact.Testing
tests/Run-Tests.ps1passes under Windows PowerShell 5.1 and PowerShell 7.-DownloadOnlyrun against Microsoft printed the new download section: 10 packages, 496 MB, 16 unneeded frameworks skipped.FAILlines.🤖 Generated with Claude Code