Run Selection (F8) has disappeared from VS Code / PS 5,1

In Powershell ISE 5.1, there exists a “Run selection” in which only the highlighted block of code is executed. It used to have an equivalent counterpart in the VS Code (6.1) environment: F8 (under 'Go or ‘Debug’ on the menu). While I cannot be 100% sure now, since it has “disappeared” on my system, I cannot help recalling to myself that I had spent many hours testing “one- or two- liners” in a single *.ps1 code file under VS Code, and just using the F8 key to run a selected block of code. The feature still exists in my PS ISE 5.1 (Win7), but somehow I have the feeling it (i.e., F8 key for Run Selected) just disappeared in the VS Code environment. Would be grateful for any guidance or advice.

What is the version of VSCode you use ? and what all settings change you did in VSCode .

Hello Mr KVprasoon,

I’m using VS Code 1.30.0 (user setup), based on the Help >> About.

I’m not sure/clear on what settings you are referring to.

Could you kindly please clarify?

Many thanks.

Hi,

If you right click on the highlighted text do you get the option to “Run Selection”? Or if you highlight text and click “Terminal” in the menu bar do you have the option to “Run Selected Text”?

I’m sorry … Mr Kvprasoon and Mr Snakes …

Yes, when I right click the selected block of code I get the F8 for Run Selection.

But – and this is where I made a mistake – I always thought it came from the drop-down menu under “Debug” – where the typical F5 (Start debugging) and Ctrl+F5 (Start without debugging) are also located. I don’t know why I remembered it this way. I could swear I used F8 many times from Debug (maybe I’m dreaming!).

My apologies and sincerest thanks to you both.

Best,

Hi Ramon,

No problem at all, glad to help.