This topic contains 5 replies, has 3 voices, and was last updated by
December 17, 2018 at 6:37 am #130274
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.
December 17, 2018 at 11:36 am #130302ModeratorPoints: 1,991Rank: Community Hero
What is the version of VSCode you use ? and what all settings change you did in VSCode .
December 17, 2018 at 3:34 pm #130350
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?
December 17, 2018 at 3:39 pm #130352ParticipantPoints: 17Rank: Member
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"?
December 17, 2018 at 4:54 pm #130365
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.
December 17, 2018 at 5:09 pm #130373ParticipantPoints: 17Rank: Member
No problem at all, glad to help.
The topic ‘Run Selection (F8) has disappeared from VS Code / PS 5,1’ is closed to new replies.