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 ?
Asked
Active
Viewed 1,157 times
0
-
Any command you try from Powershell can be logged using `$command |out-file $fileName`. Have you tried outputting the result this way? – Vish Apr 11 '14 at 06:34
-
ok let me give me a try... – Anurag Apr 11 '14 at 06:42
1 Answers
0
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

Ansgar Wiechers
- 193,178
- 25
- 254
- 328