I'm trying to run a powershell script as follows:
Start-Process -FilePath "C:\svn\Services\trunk\Services.In4m.Agent.Host\bin\agent.exe" -Argument --help
Any reason why this could be happening. Also, how to write a script so that the command prompt window does not close immediately?
It looks like the program is ending. If the command just outputs the help text and ends, the window will close upon completion.
Your best bet will be to capture the output from the command and display it out to the user.
If you want to open a separate window and wait for the user to hit enter to close it, you could do something like this:
It just depends on what you're trying to achieve.