I'm trying to move away from Command Prompt, because it's a dead-end, over to PowerShell (ISE). I haven't figured out how to run command-line applications within the PowerShell (ISE) window. Everytime I use Start-Process a Command Prompt window appears (and disappears). I've seen some people suggest -Wait and -NoNewWindow but those haven't worked for me so far.
Start-Process MyApplication.exe
This starts Command Prompt, runs the application and disappears. PowerShell remains responsive.
Start-Process MyApplication.exe -Wait
This starts Command Prompt, runs the application and disappears. PowerShell doesn't get responsive until Command Prompt has exited.
Start-Process MyApplication.exe -Wait -NoNewWindow
This results in the following:
Start-Process : This command cannot be run due to the error: The system can not find the file specified.
.
in PowerShell represents the current directory. This is to ensure that a user is not fooled into running a malicious executable at a folder specified by the$env:Path
environment variable.From the about_Command_Precedence help content: