In Windows 10 with PowerShell 7.3.3. I have a program foo.exe
on my path. I can invoke it like this:
foo test
I want to insert the parameter --bar
before all arguments. My first thought is to create a function in my $PROFILE
like this:
function foo {
foo --bar @args
}
Obviously that doesn't work, because it results in an endless loop (the function calls itself).
How can I invoke the command/program foo
from within the function foo
? I'm guessing I can research and do something like the Bash $(pwd)
and then create a path to the original executable, and hopefully that would bypass the function. But is there an easier way?