¿Cómo puedo ejecutar un programa externo con parámetros en PowerShell?
He leído esta respuestadesbordamiento de pila Responde y llego yo a mitad de camino. Esto es lo que necesito hacer.
Ejecuta este comando:
"c:\myexe.exe <c:\Users\Me\myanswerfile.txt"
Si ejecuto eso directamente desde mi script de powershell
&'c:\myexe.exe <c:\Users\Me\myanswerfile.txt'
Me sale este error:
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.
Ahora he intentado varias variaciones de esto, incluyendo colocar el comando original en una variable llamada $ cmd y luego pasar el comando
Si agrego '<' a la variable $ cmd, el comando falla con un error similar al primero.
Estoy perplejo. ¿Alguna sugerencia?