Basically, I’m trying to use Start-Process to run DCPromo, but I would like it to still provide its standard output to the console but also write it.
I’ve tried every way I can think of to get Tee-Object to do it, but the most I’ve been able to get out of it is the process details, otherwise it just writes a blank file.
This is the command I use now:
$dcPromo = Start-Process -FilePath dcpromo.exe -ArgumentList $dcPromoArgs -PassThru -NoNewWindow -Wait -RedirectStandardOutput $promoLog
submitted by /u/Computermaster
[link] [comments]
The post Write external program output to console and file simultaneously appeared first on How to Code .NET.