Add UTF-8 BOM to PowerShell files with non-ASCII characters#2195
Open
Add UTF-8 BOM to PowerShell files with non-ASCII characters#2195
Conversation
…alyzer CI failure Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/4bad420d-b6e0-4142-9144-8987b7ccbaba Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
mazhelez
April 1, 2026 14:09
View session
mazhelez
approved these changes
Apr 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a CI failure in PSScriptAnalyzer/ConvertTo-SARIF by ensuring PowerShell scripts that contain non-ASCII characters are encoded as UTF-8 with BOM, satisfying PSUseBOMForUnicodeEncodedFile.
Changes:
- Added UTF-8 BOM to
Tests/CompileFromWorkspace.Test.ps1(contains box-drawing characters in help text). - Added UTF-8 BOM to
e2eTests/scenarios/WorkspaceCompilation/runtest.ps1(contains em-dash characters in comments).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Tests/CompileFromWorkspace.Test.ps1 | Adds UTF-8 BOM so non-ASCII box-drawing characters don’t trigger the analyzer/SARIF crash. |
| e2eTests/scenarios/WorkspaceCompilation/runtest.ps1 | Adds UTF-8 BOM so non-ASCII em-dashes don’t trigger the analyzer/SARIF crash. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aholstrup1
approved these changes
Apr 1, 2026
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.
❔What, Why & How
PSScriptAnalyzer CI fails with:
Two files contain non-ASCII characters (box-drawing
├│└, em-dash—) without UTF-8 BOM. This triggersPSUseBOMForUnicodeEncodedFile, a file-level rule that emits diagnostic records with noLineproperty — crashingConvertTo-SARIFwhen it accesses$this.Extent.StartLineNumber.Tests/CompileFromWorkspace.Test.ps1ande2eTests/scenarios/WorkspaceCompilation/runtest.ps1, consistent with all other.ps1/.psm1files in the repo that contain non-ASCII content.✅ Checklist