how multi-process write to same host console?

There are three jobs:

Job1: ping 127.0.0.1 -t | foreach {"$(get-date)"+$_} |Tee-Object -FilePath ".\log1.log", 

Job2: ping 127.0.0.1 -t | foreach {"$(get-date)"+$_} |Tee-Object -FilePath ".\log2.log",

Job3: from serial port read device log, add timestamp, and write to a file, named "log3.log",

And, I want these three jobs write their out to the same host console in parallel´╝îat the same time, write to same log file named "log4.log".

I tried start-job, it's background, and I can't write to host.

I tried Powershell::create() , the same as start-job, backgroud running.

I tried start-process, but it's sames can't surpport script block.

I tried work flow, but Job3 in inlinescript can't not write file.

Please help me. Thanks!!!

Parents Reply Children
No Data