首页 > 解决方案 > 如何从 Start-Process 获取输出

问题描述

如何从命令中获取输出?

为简单起见:

$proc = Start-Process ls -PassThru -Wait -ArgumentList '-a' 
$OutPut = $proc.StandardOutput.ReadToEnd()

错误:

<Error retrieving property - InvalidOperationException>

标签: powershellpowershell-3.0

解决方案


推荐阅读