Dear forum users,
I’m sure this has been asked thousands of times, but I can’t either find the right thread or read it right.
I’m trying to call an exe, with some arguments.
Doing it in powershell 7 behaviors normally (my exe correctly launches with correct args), but in a script, I can’t get it to work (exe starting with bad args (can’t tell which as there is no output, just the help windows showing up)).
These are completely different commands. In your first example. you have --format, --csv, and --out which are completely missing in the second. I would assume you’re trying to populate those with the variables $Format, $OptionFIle, and $OutFile but since you fail to show how those are created/what they hold, it would be only that, a wild guess. The next difference is you have hard coded paths in your first example, in the second you have variables. You should first try to turn your working command into your second example before changing/adding variables. Once you know you have the structure working, then you can move on to populate with variables.
So first, we are going to break your original command down