Skip to content

install.ps1: syntax error in Linux PATH branch causes script to fail on Windows too #6

Description

@AronRubin

Bug

Running the quick-install one-liner on Windows fails with a parser error even though the broken code is in a Linux-only branch:

\
iwr https://raw.githubusercontent.com/standardbeagle/ps-bash/main/install.ps1 | iex
\\

Error:
\
ParserError: install.ps1:99:44
Line |
99 | \ = "export PATH="""":\"
| ~~~~~~~~~~~~~~~~~~~~~~~
| Unexpected token '\"":\"' in expression or statement.
\\

Root Cause

Line 99 uses \"\ as a string escape inside a double-quoted PowerShell string, which is not valid PowerShell syntax. The correct escape is \". PowerShell parses the entire script before executing it, so this syntax error in the Linux branch aborts the script on Windows before any code runs.

\\powershell

Line 99 — current (broken)

\ = "export PATH="""":\"

Fix

\ = "export PATH="\":\"
\\

Environment

  • OS: Windows 11
  • PowerShell: 7.6.2
  • Affected: both \iwr ... | iex\ and saving to file and running with \pwsh -File\

Workaround

Download the zip directly from the Releases page and extract \ps-bash.exe\ manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions