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
  • 12,708
  • 2
  • 36
  • 40
SimonS
  • 1,891
  • 1
  • 29
  • 53

1 Answers1

18

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,271
  • 1
  • 15
  • 29