start-Transcript not capturing all output to log file..?

前端 未结 5 380
难免孤独
难免孤独 2020-12-11 00:15

I have the below code that goes through and gets scheduled tasks info and puts the output that occurs on the screen to a log file.

However, what I have noticed is t

5条回答
  •  再見小時候
    2020-12-11 00:59

    Ahh, the correct answer should be:

    $Command = "schtasks.exe /query /S $name /fo CSV /v 2>&1 >$scheduledpath\$name.csv"

    I.e. pipe stderror (pipe 2) to stdout (pipe 1), so that both shows in the stdout.

提交回复
热议问题