Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell Loop Freezing, waiting for enter when there is no input needed [duplicate]

I have a powershell script that is looping while connecting to server, and checking to see if some jobs are done. It checks, sleeps for 60 seconds and then checks again. The script will keep checking until no jobs are found.

However, every now and then, the script just hangs for no reason. If I hit enter, it starts up again. There is no input in this entire script. At no point do I grab anything from the host. Why is it doing this and how can I prevent it? It's no good for automation if I have to randomly hit enter for no reason.

BTW, I am using Powershell 2.0.

Thanks in advance

like image 767
Jay Avatar asked Oct 27 '25 02:10

Jay


1 Answers

Is it running in a Console window? If so have you managed to start a select (with the mouse): the title should have changed to start "Select".

When selecting the console window is frozen... and if only one character cell is selected it can be hard to spot...

like image 139
Richard Avatar answered Oct 29 '25 03:10

Richard