I need to execute a program. Â The program has a switch that I need to pass to it. Â The switch is throwing everything off. Â I tried looking through the help and did not notice any options.
invoke-item "c:\test\text.exe"
I need to pass the switches /I and /Q
If there is a better way to accomplish outside of using invoke-item, I'm fine with that.
[quote=7894]You don’t need Invoke-Item.
<pre class=“d4pbbc-pre”>c:\test\text.exe /I /Q
Should work fine. If it doesn’t, and you’re using PowerShell 3, consider using the “stop parsing the rest of this line†operator:
<pre class=“d4pbbc-pre”>c:\test\text.exe %– /I /Q
(from http://technet.microsoft.com/en-us/library/hh847892.aspx) [/quote]
Don, that works perfectly thank you. Â Is there some trick to getting it to work when spacing is applicable? Â For example:
c:\test\test.exe works perfectly
c:\program files\test 1\test.exe does not work. Â Enclosing it in single quotes or double quotes is not doing anything.