0

I am trying to redirect input in Powershell by

Get-Content input.txt | my-program args

The problem is the piped text is preceded with a BOM (0xefbbbf), and my program cannot handle that correctly. Is there any way to redirect the input without generating a BOM, or is there any workaround?

user
  • 111

1 Answers1

0

This worked for me:

[Console]::InputEncoding = [System.Text.UTF8Encoding]::new()
Zombo
  • 1