Context
PowerShell source files in a repository may have inconsistent file encodings. If files are not uniformly UTF-8 with BOM, it can cause issues with special characters, tests, or module loading.
Request
A pre-commit or CI step should ensure all relevant source files (.ps1, .psm1, .psd1, etc.) are encoded as UTF-8 with BOM before changes are pushed. This prevents encoding inconsistencies from being introduced into the repository.
What is expected
- All PowerShell source files are validated and/or converted to UTF-8 with BOM encoding
- The check runs automatically (pre-commit hook or CI step)
- Developers are informed when files with incorrect encoding are detected
Acceptance criteria
- An automated step validates file encoding before code enters the repository
- Files with incorrect encoding are either auto-converted or flagged for the developer
- The solution works cross-platform (Windows, macOS, Linux)
Technical decisions
To be determined during implementation planning — evaluate pre-commit hook vs. CI step vs. build-time conversion.
Implementation plan
Context
PowerShell source files in a repository may have inconsistent file encodings. If files are not uniformly UTF-8 with BOM, it can cause issues with special characters, tests, or module loading.
Request
A pre-commit or CI step should ensure all relevant source files (
.ps1,.psm1,.psd1, etc.) are encoded as UTF-8 with BOM before changes are pushed. This prevents encoding inconsistencies from being introduced into the repository.What is expected
Acceptance criteria
Technical decisions
To be determined during implementation planning — evaluate pre-commit hook vs. CI step vs. build-time conversion.
Implementation plan
.ps1,.psm1,.psd1files