Fix: Remove UTF-8 BOM breaking iwr | iex install#1
Open
RawCooked wants to merge 1 commit into
Open
Conversation
The BOM bytes (EF BB BF) caused `iwr ... | iex` to fail with "???<# is not recognized" because PowerShell does not strip the BOM when executing piped string content via Invoke-Expression. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
install.ps1,core.ps1, andutils.ps1Problem
Running the one-command install:
failed with:
The
???are the UTF-8 BOM bytes rendered as replacement characters. Wheniwrdownloads the script and pipes it as a string toInvoke-Expression, PowerShell does not strip the BOM — it treats it as part of the command name, causing an immediate crash.Fix
Re-encoded all three
.ps1files as UTF-8 without BOM usingSystem.Text.UTF8Encoding($false). The scripts are otherwise identical — only the invisible leading bytes changed.Testing
Verify the first bytes of each file are now
3C 23(<#) rather thanEF BB BF 3C 23.