Closed akshinmustafayev closed 2 years ago
Try running with a different encoding? E.g.:
result.ListenAsync(Encoding.UTF8)
Tried. No luck.
Does the result change if you wrap PowerShell Core instead of legacy PowerShell?
Did not try, but PowerShell legacy version is a must for me to work first.
Yeah, I just wanted to see if that one works because PSC uses UTF-8 encoding by default. Anyway, I think you may need to do something to convince PowerShell to use UTF-8 encoding when running without a terminal.
Sorry I couldn't help more
Version
3.4.4
Details
I am trying to execute PowerShell script via executing powershell like this:
Contents of my file.ps1 is:
file.ps1 is saved in UTF-8-BOM encoding.
When I execute this script manually from PowerShell window, I get expected characters, but when I execute this from CliWrap I get messed up output with unknown encoding, or application crashes if WithValidation(CommandResultValidation.None) not specified.
Steps to reproduce