Documentation Index
Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
Use this file to discover all available pages before exploring further.
powershell/PSUseBOMForUnicodeEncodedFile is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | PSScriptAnalyzer |
| Auto-fix | No |
Description
For a file encoded with a format other than ASCII, ensure Byte Order Mark (BOM) is present to ensure that any application consuming this file can interpret it correctly. You can use this rule to test any arbitrary text file, but the intent is to ensure that PowerShell scripts are saved with a BOM when using a Unicode encoding.How
For PowerShell commands that write to files, ensure that you set the encoding parameter to a value that produces a BOM. In PowerShell 7 and higher, the following values of the Encoding parameter produce a BOM:bigendianunicodebigendianutf32oemunicodeutf32utf8BOM