Frank
2008-04-24 03:51:01 UTC
Hi,
I have a situation where I need to define the executable with the path to be
used with invoke-expression. It works with putting the path in there but
because the path has a space, an error becomes of it. The program path has a
space in it where it is:
$testcmd = "C:\Program Files\test\testutil"
$CMD = "$testcmd param1"
invoke-expression $CMD
When I execute this, I get:
The term 'C:\Program' is not recognized as a cmdlet, function, operable
program, or script file. Verify the term and try again.
When I use & in place of invoke-expression, I also get an error. Is there a
way around this other than putting the directory of the executable in the
path?
Thanks in advance,
I have a situation where I need to define the executable with the path to be
used with invoke-expression. It works with putting the path in there but
because the path has a space, an error becomes of it. The program path has a
space in it where it is:
$testcmd = "C:\Program Files\test\testutil"
$CMD = "$testcmd param1"
invoke-expression $CMD
When I execute this, I get:
The term 'C:\Program' is not recognized as a cmdlet, function, operable
program, or script file. Verify the term and try again.
When I use & in place of invoke-expression, I also get an error. Is there a
way around this other than putting the directory of the executable in the
path?
Thanks in advance,