Как выполнить внешнюю программу с параметрами в PowerShell?
Я прочитал этот ответпереполнение стека ответьте, и это приведет меня туда на полпути. Вот что мне нужно сделать.
Выполните эту команду:
"c:\myexe.exe <c:\Users\Me\myanswerfile.txt"
Если я запускаю это прямо из скрипта PowerShell
&'c:\myexe.exe <c:\Users\Me\myanswerfile.txt'
Я получаю эту ошибку:
The term 'C:\myexe.exe <c:\Users\Me\myanswerfile.txt' is not recognized as the name of
a cmdlet, function, script file, or operable program. Check the spelling of the name,or
if a path was included, verif that the path is correct and try again.
Now I have tried several variations of this including placing the original command in a variable called $cmd and then passing the
Если я добавлю «& lt;» с переменной $ cmd команда завершается с ошибкой, аналогичной первой.
Я в тупике. Какие-либо предложения?