Skip to content

Fix install script premature string termination for older versions of PowerShell/Windows#4

Open
Fantazstic wants to merge 1 commit into
titaniummachine1:mainfrom
Fantazstic:fix-install-script-parsing
Open

Fix install script premature string termination for older versions of PowerShell/Windows#4
Fantazstic wants to merge 1 commit into
titaniummachine1:mainfrom
Fantazstic:fix-install-script-parsing

Conversation

@Fantazstic

@Fantazstic Fantazstic commented Jun 19, 2026

Copy link
Copy Markdown

PowerShell 5.1 (Windows 10 22H2) reads UTF-8 files as Windows-1252 by default, and the UTF-8 byte sequence for — (em dash) contains 0x94, which Windows-1252 maps to " (right double quotation mark) which is a valid string terminator in PowerShell.

This caused the string literals on lines 59, 152, and 165 to be prematurely closed, making the enclosing if/else blocks appear unclosed. Replacing all three em dashes with - resolved such errors during install.

Summary by CodeRabbit

  • Chores
    • Updated installation script console messages to use consistent text formatting across user-facing notifications.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Three console output strings in scripts/install.ps1 have an em dash () replaced with a standard hyphen (-): the "npm not found" skip message, the "node not found" web refresh skip message, and the "No binary is stored in git" message.

Changes

Console Message Dash Character Fix

Layer / File(s) Summary
Console message dash replacements
scripts/install.ps1
Replaces em dash () with hyphen (-) in three console output strings: npm-not-found, node-not-found, and no-binary-stored messages.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A dash too wide, a character rare,
The em dash lurked in messages there.
🐇 With one small swap, a hyphen now stands,
Tidied up by some careful hands.
Simple and clean, the console agrees! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main issue: a character encoding problem causing premature string termination in PowerShell on older Windows versions, which aligns with the actual changes made to fix UTF-8 em dash handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/install.ps1 (1)

1-166: 💤 Low value

Note: Static analysis reports missing BOM encoding, but current fix addresses root issue.

PSScriptAnalyzer warns about missing UTF-8 BOM for files with non-ASCII characters, which can cause Windows PowerShell to misinterpret the script as legacy "ANSI" codepage. However, the current fix strategically removes all non-ASCII characters (replacing em dashes with hyphens), which resolves the encoding conflict entirely and makes the BOM warning moot. The script now contains only ASCII characters and will parse consistently across PowerShell versions without requiring BOM.

For future maintenance: if non-ASCII characters are reintroduced, save the file as UTF-8 with BOM if Windows PowerShell 5.1 compatibility is needed. For now, the current approach is effective and doesn't require immediate action.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/install.ps1` around lines 1 - 166, The review comment notes that
PSScriptAnalyzer may report missing UTF-8 BOM encoding, but confirms this has
already been resolved by removing all non-ASCII characters from the script
(replacing em dashes with hyphens in the section headers throughout the file).
No immediate action is required. However, for future reference: if non-ASCII
characters need to be reintroduced anywhere in the install.ps1 script, ensure
the file is saved as UTF-8 with BOM encoding to maintain compatibility with
Windows PowerShell 5.1 and avoid codepage misinterpretation issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@scripts/install.ps1`:
- Around line 1-166: The review comment notes that PSScriptAnalyzer may report
missing UTF-8 BOM encoding, but confirms this has already been resolved by
removing all non-ASCII characters from the script (replacing em dashes with
hyphens in the section headers throughout the file). No immediate action is
required. However, for future reference: if non-ASCII characters need to be
reintroduced anywhere in the install.ps1 script, ensure the file is saved as
UTF-8 with BOM encoding to maintain compatibility with Windows PowerShell 5.1
and avoid codepage misinterpretation issues.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d3917a3-7a24-4657-8b34-39b7c6170157

📥 Commits

Reviewing files that changed from the base of the PR and between 680e254 and 545f5e4.

📒 Files selected for processing (1)
  • scripts/install.ps1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant