Can we capture log if we run a job from powershell

半腔热情 提交于 2019-12-13 05:15:06

问题


Can we capture logs if we run a job from power shell . As we are trying to run a control-m job from windows servers 2008 and its getting failed so we tried to run it from power shell . Is there any way to capture logs as job is failing in power shell also ?


回答1:


You could use Start-Transcript for logging the actions/output of a script. You need to make sure the user running the script has write access to the output location.

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

# production code here

Stop-Transcript


来源:https://stackoverflow.com/questions/23005098/can-we-capture-log-if-we-run-a-job-from-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!