I need to pipe some data to a program\'s stdin.
I need to pipe some data to a program's stdin.
Many complex answers to this simple task. You can indeed cause many problems when using different encodings. Here is a different approach, without any encoding applied by Get-
/Set-Content
.
You can actually pipe binary data to an external program by using the Start-Process
cmdlet pretty easily:
Start-Process my.exe -RedirectStandardInput my.bin
Works at least since PowerShell 2.0.