chazbot7 chazbot7 - 3 years ago 312
PowerShell Question

Write output of a java program fired from Powershell to standard output

I have a powershell script that is calling a jar via the following code:

Start-Process java -ArgumentList '-jar', "$jarPath", "$csvPath"

However, the output from the jar is not coming through. I'm pretty sure its running successfully, but I'd like to be sure. How can I pass it through to the Powershell console?

Answer Source

Replace Start-Process with the call operator:

& java -jar $jarPath $csvPath
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download