chazbot7 chazbot7 - 1 year ago 58
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