0

I am using powershell to call an executable app.exe.

I can call app.exe with a parameter myparam multiple times - so this would be a valid call from within powershell:

& app.exe --myparam 1 --myparam 2 --myparam 3

However, in my scenario I do not know how many instances of myparam I need to pass to app.exe until runtime.

If I wanted to dynamically pass parameters with different names I am aware that I could use splatting - but this doesn't work for me because I cannot add multiple instances of the key myparam to the hash table.

Lawrence
  • 3,287
  • 19
  • 32
  • `iex "& app.exe --myparam 1 --myparam 2 --myparam 3"`.. Check https://stackoverflow.com/questions/6338015/how-do-you-execute-an-arbitrary-native-command-from-a-string – laika Jan 17 '19 at 13:40
  • Just what I was after - thank you! – Lawrence Jan 17 '19 at 13:47

0 Answers0