fix: CLI and GUI bug sweep#30
Merged
Merged
Conversation
…pair SFC, pacman orphan crash, Ctrl+C continuous ping, firmware type registry read, HP device guard, wrap tool invocations in try/catch Agent-Logs-Url: https://github.com/Stensel8/pcHealth/sessions/cf096b38-0fd6-41db-ae20-3da052e5ff82 Co-authored-by: Stensel8 <102481635+Stensel8@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Stensel8/pcHealth/sessions/cf096b38-0fd6-41db-ae20-3da052e5ff82 Co-authored-by: Stensel8 <102481635+Stensel8@users.noreply.github.com>
…s, wrong repo URLs, regex class, registry property access Agent-Logs-Url: https://github.com/Stensel8/pcHealth/sessions/012607b5-b250-425e-8f9b-2dbb071b2bb3 Co-authored-by: Stensel8 <102481635+Stensel8@users.noreply.github.com>
…rd, scanArgs if-else, ProcessRunner explicit CTS disposal Agent-Logs-Url: https://github.com/Stensel8/pcHealth/sessions/012607b5-b250-425e-8f9b-2dbb071b2bb3 Co-authored-by: Stensel8 <102481635+Stensel8@users.noreply.github.com>
…, DBUS pattern variable, WinRE X:\ comment, Write-Debug on missing registry value Agent-Logs-Url: https://github.com/Stensel8/pcHealth/sessions/012607b5-b250-425e-8f9b-2dbb071b2bb3 Co-authored-by: Stensel8 <102481635+Stensel8@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Stensel8
May 2, 2026 14:57
View session
There was a problem hiding this comment.
Pull request overview
This PR is a cross-cutting bug-sweep for pcHealth’s PowerShell CLI and WinUI GUI, focused on safer process execution, more reliable OS/environment detection, and correcting stale repository links used across the app.
Changes:
- Hardens command/process launching in both CLI and GUI, including Linux audio restart, GUI subprocess timeouts, and Windows tool launch paths.
- Fixes correctness issues in system-info, boot-repair, settings parsing, and license-key decoding logic.
- Updates stale GitHub links and release-check behavior to point at the current repository owner.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/GUI/pcHealth/Services/UpdateChecker.cs |
Updates GitHub release API URL and loosens tag parsing for suffixed versions. |
src/GUI/pcHealth/Services/ProcessRunner.cs |
Adds a default timeout path to GUI subprocess execution. |
src/GUI/pcHealth/Services/AppSettings.cs |
Makes boolean settings parsing case-insensitive and accepts "1". |
src/GUI/pcHealth/Pages/InfoPage.xaml |
Fixes repository and issue tracker hyperlinks. |
src/GUI/pcHealth/Pages/HealthPage.xaml.cs |
Guards UI updates after unload and reworks smartctl capture/argument handling. |
src/GUI/pcHealth/MainWindow.xaml.cs |
Fixes the releases URL opened from the update prompt. |
src/CLI/tools/linux/Invoke-DiskCleanup.ps1 |
Skips orphan removal when pacman reports no orphaned packages. |
src/CLI/tools/linux/Invoke-AudioRestart.ps1 |
Removes shell-string execution and validates DBUS forwarding. |
src/CLI/tools/Test-NetworkContinuous.ps1 |
Adds try/finally around the continuous ping loop. |
src/CLI/tools/Invoke-PowerOptions.ps1 |
Quotes the Linux username passed to loginctl. |
src/CLI/tools/Invoke-HPUpdate.ps1 |
Prompts before installing HP tooling on non-HP hardware. |
src/CLI/tools/Invoke-DiskOptimize.ps1 |
Launches Defrag/Optimize from an explicit System32 path. |
src/CLI/tools/Invoke-DiskCleanup.ps1 |
Launches Disk Cleanup from an explicit System32 path. |
src/CLI/tools/Invoke-BootRepair.ps1 |
Switches live-session SFC to /scannow and gates offline flags on environment detection. |
src/CLI/tools/Get-SystemInfo.ps1 |
Reads firmware type from the registry instead of an environment variable. |
src/CLI/tools/Get-LicenseKey.ps1 |
Simplifies a dead bitwise expression in DigitalProductId decoding. |
src/CLI/menus/Tools.ps1 |
Wraps tool execution in try/catch to keep the menu alive on failures. |
src/CLI/menus/Main.ps1 |
Fixes owner branding/URLs and adds browser-launch error handling. |
src/CLI/Start.ps1 |
Guards empty uname -r output before parsing the kernel version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| CancellationToken ct = default, | ||
| TimeSpan timeout = default) | ||
| { | ||
| if (timeout == default) timeout = DefaultTimeout; |
| CancellationToken ct = default, | ||
| TimeSpan timeout = default) | ||
| { | ||
| if (timeout == default) timeout = DefaultTimeout; |
Comment on lines
+538
to
+543
| // Read output before WaitForExit to avoid a deadlock when the | ||
| // redirected buffer fills up. | ||
| var output = proc.StandardOutput.ReadToEnd(); | ||
| proc.WaitForExit(); | ||
| // 30-second hard cap: a drive that is failing or unresponsive can | ||
| // cause smartctl to hang indefinitely without this guard. | ||
| if (!proc.WaitForExit(30_000)) |
Comment on lines
+581
to
+583
| proc.Start(); | ||
| var output = proc.StandardOutput.ReadToEnd(); | ||
| if (!proc.WaitForExit(30_000)) |
Comment on lines
+57
to
+60
| if (Test-Path 'X:\') { | ||
| # WinRE always maps its RAM-disk to X:\ — this is enforced by the Windows | ||
| # boot environment and is not a user-configurable drive letter, so this | ||
| # check reliably distinguishes a WinRE session from a normal Windows boot. |
| Write-Host " Request timed out." -ForegroundColor Red | ||
| } | ||
| Start-Sleep -Seconds 1 | ||
| } |
Remove an extra '#' in a comment so it reads 'Requires -Version 7.0' and more clearly explains that using '#Requires -Version 7.0' would throw at parse time and block the re-launch under PowerShell 7. This is a cosmetic clarification only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed 19 bugs across the CLI (PowerShell) and GUI (C#/WinUI 3).
CLI
linux/Invoke-AudioRestart.ps1- command injection viabash -c; rewritten to callsystemctldirectly viasudo -u "$user" env KEY=VALUE; DBUS address validated against known transport prefixes before uselinux/Invoke-AudioRestart.ps1- PulseAudio kill+start was a single shell compound string; split into two separate invocationslinux/Invoke-DiskCleanup.ps1-pacman -Rnswith an empty list caused a confusing non-zero exit; now skips whenpacman -Qdtqreturns nothingStart.ps1- crash whenuname -rreturns nothing; fixed kernel version regex to also split on-(e.g.6.1-gentoo)Get-SystemInfo.ps1-$env:firmware_typeis only set in WinPE/MDT, always empty in live sessions; replaced withPEFirmwareTyperegistry readInvoke-BootRepair.ps1-/offbootdirand/offwindirflags are invalid in a live SFC session; now only passed when running from WinRE (X:\check)Invoke-HPUpdate.ps1- HP Image Assistant was installed silently on non-HP hardware; now checksWin32_ComputerSystem.Manufacturerand prompts before continuingmenus/Tools.ps1- unhandled terminating error in a tool script crashed the entire menu session; wrapped intry/catchTest-NetworkContinuous.ps1- Ctrl+C inside the ping loop propagated an exception back to the menu; wrapped intry/finallyInvoke-DiskCleanup.ps1/Invoke-DiskOptimize.ps1- barecleanmgr.exe/dfrgui.exeresolved via PATH; switched to full$env:SystemRoot\System32\...pathInvoke-PowerOptions.ps1- unquoted$env:USERinloginctlcall breaks on usernames with spacesGet-LicenseKey.ps1-(($isWin8Plus -band 2) -shl 2)is always 0 since$isWin8Plusis 0 or 1; removed the dead expressionGUI
ProcessRunner.cs- no timeout meant a hung subprocess blocked the UI indefinitely; added configurable timeout (default 10 min) with proper linkedCancellationTokenSourcedisposalUpdateChecker.cs-Version.TryParsefailed on pre-release tags likev2.1.0-rc1; strip hyphen suffix before parsingAppSettings.cs-GetBoolcomparedraw == "true"(case-sensitive), silently ignoring"True"and"1"HealthPage.xaml.cs- battery timer started even when the page was navigated away beforeGatherDatacompleted; addedIsLoadedguardHealthPage.xaml.cs-ReadToEnd()afterWaitForExit()could deadlock on a full pipe buffer; added 30s hard timeout withKill(entireProcessTree: true)HealthPage.xaml.cs-smartctldevice path was string-interpolated with manual quoting; replaced withRunCaptureWithArgsusingProcessStartInfo.ArgumentListInfoPage.xaml/MainWindow.xaml.cs- stale GitHub URLs