3

I want to pass a netstat -t -b 90 command and tell the prompt to simultaneously or successively perform this command to launch network monitor start netmon /autostart.

2 Answers 2

2

The Start-Job command in PowerShell will do what you want. You'll want to use it in conjunction with Wait-Job and Receive-Job.

For example:

$netstat = Start-Job {netstat -t -b 90}
$ping = Start-Job {ping 192.168.1.1}
Wait-Job $netstat,$ping
Receive-Job $netstat,$ping

The first two lines will begin the netstat and ping jobs, and store the job objects. Wait-Job will wait until the two jobs are finished. Receive-Job displays the output.

0
0

You could use start-process, if you're not picky about launching them in a separate window rather than in the background.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.