none
Why Does PowerShell "Pause" Until I Press Enter or the Down Arrow Key? RRS feed

  • Question

  • Windows 8.1.  This has been an issue for me on multiple computers including Windows 7 and Server 2008 R2.  At various stages, for no discernable reason, PowerShell will just stop what it's doing until I press a key to wake it up.  Here is 1 example:

    Yesterday I ran a command and forgot about it; left it running:

    ping -t 10.1.7.10

    Pretty basic, right?  As I said, I forgot about it.  At the end of the day I locked my computer and went home.  I came in this morning, and here is all that I have in my PowerShell window:

    PS U:\> ping -t 10.1.7.10
    
    Pinging 10.1.7.10 with 32 bytes of data:
    Request timed out.

    There was only 1 ping attempt!  If you are not familiar with ping, the -t switch tells it to send a never-ending stream of ICMP packets until I tell it to stop.

    As soon as I highlighted the text and pressed Enter to copy it to the clipboard for this post, the ping command picked up right where it left off; it resumed pinging and showing me the results.  I already have a full page of "Request timed out."

    What gives?  Am I doing something to interrupt PowerShell without realizing it?


    • Edited by J-LA Wednesday, July 30, 2014 1:45 PM
    Wednesday, July 30, 2014 1:44 PM

Answers

  • Hi,

    Yeah, you probably are. If you click anywhere in the console window you'll start automatically selecting and the window output will stop. Do you see the word 'Select' in the window title? If so, that's the culprit.


    EDIT: Slow on the submit button... See above.

    Don't retire TechNet! - (Don't give up yet - 12,950+ strong and growing)

    • Edited by Mike Laughlin Wednesday, July 30, 2014 1:51 PM
    • Proposed as answer by jrv Wednesday, July 30, 2014 1:53 PM
    • Marked as answer by J-LA Wednesday, July 30, 2014 2:09 PM
    Wednesday, July 30, 2014 1:50 PM
  • You might have accidentically clicked/dragged over the powershell window. While a selection is made, all operations are postponed (until you press any key).


    MCP/MCSA/MCTS/MCITP


    • Edited by SenneVL Wednesday, July 30, 2014 1:47 PM
    • Proposed as answer by Bill_StewartModerator Wednesday, July 30, 2014 2:01 PM
    • Marked as answer by J-LA Wednesday, July 30, 2014 2:33 PM
    Wednesday, July 30, 2014 1:47 PM

All replies

  • You might have accidentically clicked/dragged over the powershell window. While a selection is made, all operations are postponed (until you press any key).


    MCP/MCSA/MCTS/MCITP


    • Edited by SenneVL Wednesday, July 30, 2014 1:47 PM
    • Proposed as answer by Bill_StewartModerator Wednesday, July 30, 2014 2:01 PM
    • Marked as answer by J-LA Wednesday, July 30, 2014 2:33 PM
    Wednesday, July 30, 2014 1:47 PM
  • Not a scripting issue.  You need to fix your system or repair/install PowerShell.  You may be missing patches or have malware.


    ¯\_(ツ)_/¯

    Wednesday, July 30, 2014 1:48 PM
  • Hi,

    Yeah, you probably are. If you click anywhere in the console window you'll start automatically selecting and the window output will stop. Do you see the word 'Select' in the window title? If so, that's the culprit.


    EDIT: Slow on the submit button... See above.

    Don't retire TechNet! - (Don't give up yet - 12,950+ strong and growing)

    • Edited by Mike Laughlin Wednesday, July 30, 2014 1:51 PM
    • Proposed as answer by jrv Wednesday, July 30, 2014 1:53 PM
    • Marked as answer by J-LA Wednesday, July 30, 2014 2:09 PM
    Wednesday, July 30, 2014 1:50 PM
  • To add to Mike's good info -= you could have a bad keyboard/mouse or motherboard that are generating spurious interrupts.  I have a system that does that frequently.  Never noticed it in PowerShell but it does it on the Start screen of Win 8.

    This can also be caused by a keystroke logger that is not working correctly when it counts characters and passes them through.  Some keyloggers pass one too many characters which is why I suggested malware.


    ¯\_(ツ)_/¯

    Wednesday, July 30, 2014 1:56 PM
  • I just tested and you guys are exactly right.  Thanks!  That's what I get for being click-happy.

    Even though SenneVL posted first, I really liked the explanation about 'Select' appearing in the window's title bar.  Marked your post as the answer.


    • Edited by J-LA Wednesday, July 30, 2014 2:34 PM
    Wednesday, July 30, 2014 2:12 PM
  • You're very welcome.

    Just so you're aware, you can mark more than one post as an answer. There's not a limit of a single answer per thread or anything like that.


    Don't retire TechNet! - (Don't give up yet - 12,950+ strong and growing)

    Wednesday, July 30, 2014 2:17 PM
  • Would you look at that?  I learned 2 things in 1 thread.  That's efficiency right there.
    Wednesday, July 30, 2014 2:35 PM
  • Thanks for this. I noticed a script I started last night didn't run anything from 4:57 PM (when I locked my computer to go home) and 7:52 am (when I unlocked and clicked inside the powershell window the next morning).  I was going insane trying to find out why it paused when the PC was locked, but this was certainly the issue.


    Shawn Keene

    Wednesday, September 23, 2015 3:13 PM