is there a way to handle start-transcript in a background process? I have a script launched in background. almost everything works fine, except logging with start-transcript? in fact, it creates my $filelog.txt but doesn't write anything in it?
Asked
Active
Viewed 1,047 times
0
-
2Might be related to this: http://stackoverflow.com/questions/3835997/start-transcript-causes-script-to-fail-in-a-background-job – David Brabant May 23 '13 at 13:54
-
I don't see something really useful there. – rschirin May 23 '13 at 19:38
-
Look better. And show your script. – David Brabant May 23 '13 at 19:39
-
Possible duplicate of [start-transcript causes script to fail in a background job](http://stackoverflow.com/questions/3835997/start-transcript-causes-script-to-fail-in-a-background-job) – JohnLBevan May 18 '17 at 14:27
1 Answers
1
You cannot do it, non-interactive PowerShell hosts (in your case background job) don't support host output Cmdlets like Start-Transcript, Write-Host etc. You'd have to use you own logging functions or output messages to file via Out-File for example.

Josef Nemec
- 672
- 1
- 6
- 16