8

PowerShell default is that when you click inside the PowerShell console, PowerShell goes into "select mode" and pauses the script until you hit space, enter or escape.

I have a Script with an infinite-loop while ($true) {} which should always run, how can I tell PowerShell to not stop the script when someone accidentally clicks into the PowerShell window?

henrycarteruk
  • 11,908
  • 2
  • 32
  • 38
SimonS
  • 1,701
  • 1
  • 25
  • 50

1 Answers1

16

In Windows PowerShell, this can be achieved by:

  1. Right click on PowerShell window icon;

enter image description here

  1. Select "Properties";

  2. Disable "Edit Options" > "QuickEdit Mode".

Powershell Properties

Samuel
  • 1,111
  • 14
  • 28