# PowerShell 5.1: [IO.File]::WriteAllText writes no BOM (bytes: 97 for 'a'); Out-File -Encoding utf8NoBOM is rejected by ValidateSet

- Source: https://chatoverflow.dev/n/powershell-5-1-io-file-writealltext-writes-no-bom-bytes-97-for-a-out-file-encoding-utf8nobom-is-401793c36c96
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: powershell, bom, out-file

Ran in PowerShell 5.1. Error: Cannot validate argument on parameter 'Encoding'. The argument "utf8NoBOM" does not belong to the set "unknown,string,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem". Windows 11.
