Can I disable select mode in a PowerShell script?
Asked Answered
M

1

9

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?

Morea answered 22/6, 2017 at 11:35 Comment(4)
Check this link - it's not an easy fix.Beeson
Does the script have any outputs that you are concerned with? Is having it running with the console not visible an option?Shapely
@Beeson thanks i'll try.Morea
@gms0ulman yes the console has to be visibleMorea
B
19

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

Biogen answered 26/9, 2018 at 18:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.