Fix start.ps1: PowerShell will not parse a multi-line ternary - #9
Merged
Conversation
nekron ran the launcher and got "The term ':' is not recognized as a name of a cmdlet". My fault, from the change that taught it to launch the single executable: I wrote the choice as a ternary broken across three lines, and PowerShell ends the statement at the newline, then meets `? '...'` and `: '...'` as commands. It parses only on one line or with backtick continuations, neither of which is worth it here. An if/else expression instead, which reads better at this width anyway. Checked two ways this time rather than eyeballed: the file is run through [Parser]::ParseFile, which reports no errors, and start.ps1 was executed - it builds, starts the app, and the dashboard answers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nekron hit "Build failed." with nothing else to go on. The cause was a leftover Quantumwake.Server process of mine holding its own assemblies open, so MSBuild could not overwrite them - nothing to do with the code, and the script gave no way to know that, because it pipes the build to Out-Null and throws a bare string. Two changes, both about the same failure. The script now stops any running QuantumWake or Quantumwake.Server before building. A launcher exists to start the app; leaving the previous copy running to break the build is not a service to anyone. And when the build does fail, the error lines are printed. A bare "Build failed." sends you looking at your own last edit when the reason is a file lock, a missing SDK or a syntax error sitting in the output that was thrown away. Verified by reproducing it: started a server to lock the build, ran start.ps1, and watched it report "Stopping 1 running instance(s) first", build, and serve the dashboard. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
"When we stop the server it doesn't kill the widget." Correct, and the script was lying about who was in charge. It ended on Wait-Process with a finally that killed the child, and printed "Press Ctrl+C to stop the server". That made sense when the server was a separate hidden process the console had launched. It stopped making sense when the server moved inside QuantumWake.exe: the thing being waited on is now the whole application - tray icon, overlay and server together - and PowerShell does not guarantee the finally runs on Ctrl+C or when the terminal is closed. So the window went away, the widget stayed, and the message had promised otherwise. The app owns itself now. It has a tray icon with Quit and it holds the server inside its own process, so the launcher builds it, starts it, opens the dashboard and returns to the prompt, saying that the window can be closed and where the quit button is. -NoOverlay keeps the old behaviour, because it should: the bare server has no tray icon and no window, so that console really is the only way to stop it. Verified: the script now exits by itself, and the app is still running after it does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
peans99
added a commit
that referenced
this pull request
Aug 28, 2026
Fix start.ps1: PowerShell will not parse a multi-line ternary
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.
.\start.ps1failed immediately with:My fault, introduced when the launcher was taught to start the single executable. The choice between the app and the bare server was written as a ternary split over three lines:
PowerShell ends the statement at the newline, then meets
?and:as commands. A ternary has to be on one line, or carry backtick continuations. Replaced with anif/elseexpression, which reads better at this width regardless.Checked two ways rather than eyeballed this time:
[Parser]::ParseFilereports no errors, andstart.ps1was actually run - it builds, starts the app, and the dashboard answers on 127.0.0.1:31337.Only affects running from source. The released
QuantumWake.exenever touches this script.