Skip to content

[Bug]: install.ps1 fails to parse in Windows PowerShell when UTF-8 characters are misread #288

@sundaram2021

Description

@sundaram2021

Describe the Bug

Running ./install.ps1 in Windows PowerShell can fail before the installer starts because the script contains UTF-8 symbols such as checkmarks, em dashes, and box-drawing characters. When Windows PowerShell reads the file with the wrong encoding, those characters become mojibake such as ✓; the corrupted sequence includes a smart quote-like character that breaks a quoted string and causes a parser error near the outer catch block.

To Reproduce

Steps to reproduce the behavior:

  1. Open Windows PowerShell in the repository root.
  2. Run ./install.ps1.
  3. Observe a parser error around install.ps1:85.

Expected Behavior

The PowerShell installer should parse successfully and proceed with installing the Engram CLI and configuring supported MCP clients.

Screenshots

A screenshot from the failing run shows:

Image

Environment

  • OS: Microsoft Windows 11 Home Single Language 10.0.26200
  • PowerShell version: 5.1.26100.8115
  • Python version: 3.13.7
  • Docker version : Docker version 29.4.0

Logs

Relevant parser validation before the fix:

Unexpected token '}' in expression or statement. at line 85, col 1: }
Missing closing '}' in statement block or type definition. at line 85, col 9: {

Additional Context

The failure is caused by UTF-8 characters in install.ps1 being decoded incorrectly by Windows PowerShell 5.1. Replacing non-ASCII decorative/status characters with ASCII text, and expanding the inline nested try/catch, makes the script parse successfully.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions