0

如果我们从 power shell 运行作业,我们可以捕获日志吗?由于我们试图从 windows server 2008 运行 control-m 作业并且它失败了,所以我们尝试从 power shell 运行它。是否有任何方法可以捕获日志,因为电源外壳中的作业也失败了?

4

1 回答 1

0

您可以Start-Transcript用于记录脚本的操作/输出。您需要确保运行脚本的用户对输出位置具有写入权限。

Start-Transcript -Path 'C:\path\to\transcript.log' -Append

# production code here

Stop-Transcript
于 2014-04-11T10:42:57.790 回答