是否可以让 Powershell 将 exe 的标准输出读入 byte[] 而不是通常的文本处理行数组?
我能做的最好的事情是:
cmd /c foo.exe > foo.tmp
$b = [io.file]::readallbytes('foo.tmp')
del foo.tmp
Run Code Online (Sandbox Code Playgroud)
恶心,更不用说它不能流式传输。有更好的方法来做到这一点吗?
| 归档时间: |
|
| 查看次数: |
1396 次 |
| 最近记录: |