The '<' operator is reserved for future

2019-01-07 20:23发布

I am using PowerShell and am trying to run the following command:

.\test_cfdp.exe < test.full | tee test.log

test.full is a script that mimics command line inputs to test_cfdp.exe. However, I get the following error:

The '<' operator is reserved for future use.

Is there another way (i.e. cmdlet) I can use to get this command to work in PowerShell?

3条回答
啃猪蹄的小仙女
2楼-- · 2019-01-07 21:10

This was not supported in PowerShell v1 [and as of v5, it's still not...]

An example workaround is:

Get-Content test.full | .\test_cfdp.exe | tee test.log
查看更多
看我几分像从前
3楼-- · 2019-01-07 21:14

If you want to run this command more times, you can just make a *.bat file with the original syntax. That's another solution.

查看更多
贪生不怕死
4楼-- · 2019-01-07 21:17

Also try:

cmd /c '.\test_cfdp.exe < test.full | tee test.log'
查看更多
登录 后发表回答