【发布时间】:2015-12-22 13:39:22
【问题描述】:
我想从批处理文件中执行以下操作:
"C:\OpenCover\tools\OpenCover.Console.exe" -register:user -target:"%VS110COMNTOOLS%..\IDE\mstest.exe" -targetargs:"/testcontainer:\"C:\Develop\bin\Debug\MyUnitTests.dll\" ... "
PAUSE
现在我想将进程的输出记录到一个文件中,我遇到了非常方便的 powershell 用法
powershell "dir | tee output.log"
但这不会将我的批处理文件作为第一个参数 (powershell "my.bat | tee output.log"),因为它不是 cmdlet 或函数或脚本文件的名称。
我可以更改我的批处理文件,例如 powershell "OpenCover.Console.exe...",但我必须调整所有引号并更改转义字符等等。
有没有办法让批处理文件在 powershell 中执行?或者有没有办法在一些powershell命令之后从批处理中删除我的行并且它都“像它应该那样”执行?
【问题讨论】:
标签: powershell batch-file