...
When starting the mongo.exe process from within a PowerShell ISE session, control is not returned to the user and the prompt doesn't appear. The attached screenshot shows the expected behaviour (Command Prompt and standard PowerShell session) compared to a PowerShell ISE session.
justin.cohler commented on Fri, 13 Jan 2017 19:55:25 +0000: We currently only support cmd.exe and powershell.exe tjrobinson commented on Thu, 11 Apr 2013 12:24:41 +0000: Since it sounds like this can't be fixed fully, an error message would be good - just to let the user know what is happening. This blog post confirms the problem is in the PowerShell ISE: http://blogs.msdn.com/b/powershell/archive/2009/02/04/console-application-non-support-in-the-ise.aspx It's a shame because it's much simpler to select, copy and paste text inside the PowerShell ISE shell. tad commented on Thu, 11 Apr 2013 10:05:00 +0000: When I break into the mongo.exe process in the debugger while it is hung in PowerShell ISE, it is in a call to ReadConsoleInputW(). Since there is no console to read from, this call never returns. To either make this work when run directly in PowerShell ISE or to detect this situation and exit with an error message, we'd need some additional code. This could be done, but perhaps it isn't as worthwhile as other things that we could work on since the workaround (run the shell in the environment that it was written for, i.e. the Windows console) is pretty easy. tad commented on Thu, 11 Apr 2013 09:54:28 +0000: The 'start-process' command starts mongo.exe in its own Command Prompt window, so it works fine that way. eaoadegbile@yahoo.co.uk commented on Wed, 10 Apr 2013 23:42:50 +0000: To Start Mongo from the PowerShell ISE Session use the full path to the Mongo application,but make sure that you have a running instance of mongod or else the session will automatically close as shown below start-process C:\mongodb2_4_1\mongodb-win32-i386-2.4.1\bin\mongod.exe start-process C:\mongodb2_4_1\mongodb-win32-i386-2.4.1\bin\mongo.exe tad commented on Wed, 10 Apr 2013 22:02:41 +0000: This is a family of Windows functions that let a program work directly with its "container". For example: http://msdn.microsoft.com/en-us/library/windows/desktop/ms681913(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms682073(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms684202(v=vs.85).aspx These functions are used by the shell on Windows, and their absence is why you see nothing when running mongo.exe in the ISE. tjrobinson commented on Wed, 10 Apr 2013 20:01:59 +0000: I'm not sure what you mean by "PowerShell ISE does not provide a Console windows or its own Console API" tad commented on Wed, 10 Apr 2013 19:52:16 +0000: I'm not sure that this makes sense. The mongo.exe shell uses Windows Console APIs to get its input and produce its output, and the PowerShell ISE does not provide a Console windows or its own Console API, so this would be a rewrite of the I/O routines. The mongo.exe shell works fine in a regular PowerShell console window.
1. Open the PowerShell ISE 2. Execute mongo.exe at the PowerShell prompt 3. The following will be displayed: MongoDB shell version: 2.4.1 connecting to: test