0

I am trying to run a .jar file from Powershell that requires the user to input four parameters through Command Prompt after executing the .jar. Each parameter is inputed as a new line. I would like to automatically read these parameters in from a .csv where each line contains one parameter.

I currently run the .jar by calling java -cp some.jar. The .csv and .ps1 are in the same directory.

I know with Shell this could be done with cat parameters.csv |. Is there an equivalent in PS? This question is related but does not deal with reading a .csv.

taurus
  • 470
  • 7
  • 22
  • 2
    What have you tried already? – techguy1029 Aug 13 '19 at 20:01
  • I've never written in powershell before, so just an extensive google search – taurus Aug 13 '19 at 20:02
  • Then you may want to peruse a PowerShell tutorial first. SO is not a replacement for familiarizing yourself with a language you haven't used before. But to give you a starting point, the usual approach to something this in PowerShell is to construct an array or hashtable from the CSV data and then [splat](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_splatting?view=powershell-3.0) that on the command. – Ansgar Wiechers Aug 14 '19 at 09:59

0 Answers0