我需要捕获从.ps1文件中运行的.bat文件创建的输出.
我是PowerShell脚本的新手,但我知道这不是正确的语法.这最好地说明了我需要发生的事情.
我需要执行facter.bat脚本然后存储它的输出,$Body以便稍后我可以使用该文本.
$Body
"C:\Program Files (x86)\Puppet Labs\Puppet\bin\facter.bat" > $Body
powershell powershell-1.0
powershell ×1
powershell-1.0 ×1