5

Example of the code:

$logfile = "log.txt" $filename = "backup.rar" Start-Transcript -Path $logfile -Append -Force "Start..." Start-Process -FilePath "C:\Program Files\WinRAR\Rar.exe" -ArgumentList ("a " + $filename + " @backup.lst") -NoNewWindow -Wait "Done" Stop-Transcript 

Output in the console:

... Start... Error: Do not find backup.lst Done ... 

But in the log file:

... Start... Done ... 

Where output Rar.exe?

PS: Sorry for my bad English.

2 Answers 2

6

This is a known issue with Start-Transcript - it doesn't capture output from exes.

Sign up to request clarification or add additional context in comments.

Comments

0

My first thought is that the Start-Transaction is not capturing errors (obviously ;) )

You may want to look at using the start-process arguments of -RedirectStandardOutput and -RedirectStandardError

1 Comment

I think comments sections would be better place for this

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.