Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Write external program output to console and file simultaneously

$
0
0

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.


Viewing all articles
Browse latest Browse all 8793

Trending Articles