简体   繁体   中英

Can we capture log if we run a job from powershell

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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM