I'm not sure this is the right forum to post this but I'm using Visual Studio Code in place of the Powershell_ISE and have a slight annoyance.
When I load a PowerShell script I get a second terminal session loaded called 'Powershell Integrated Terminal' which has no syntax highlighting.
Is there a way to stop this second PowerShell console loading please or get it to use colours?
Thanks very much
Originally VSC defaulted to CMD.exe and you had to explicitly select PoSH.
The PoSH Add-in brought the PIC (VSCH) that you referencing and it is the default on script editing launch, but though it's called PowerShell Integrated Console in the drop down, if you use $host, you'll see it is actually the... note the version details...
$host Name : Visual Studio Code Host Version : 1.7.0
Vs the default PowerShell console, which does the console level color stuff. NOte the version details...
$host Name : ConsoleHost Version : 5.1.17134.48
This is really a way to get you as close to the Windows PoSH ISE environment. The ISE console also does not have color coding (well some things do) because you get that in the ISE script pane. So, in this case, VSC for the operation, this is no different than the ISE. You can pop open the ISE and see this for yourself. The Windows PoSH console has color coding, the ISE console does not as it is really meant as a output window of code you run from the script pane.
You change the way the VSC environment works, by modifying your user preferences. It is all detailed in the product docs on the MS docs site. Yet, remember, these are two separate environments and not designed to work the same way.
Honestly, their is a good deal of customization that can be done in VSC to get it to function as you'd like, but it requires you to dig at it and do a lot of trial and error to get where you want to be. Everyone has their ways of doing X or Y and you'll need to decide what is your playground, then configure it to do so.
What is really allowing the color coding in the console is PSReadline.
So, see also
So, again, using the default VSC PoSH console is no different that opening and using the Win PoSH console host.
Meaning, if you are writing a script, then start a new script file, but you lose the powers shell console.
Yet again postanote you have been very helpful. Thankyou
No worries, also of note in VSCode, you can have multiple terminal windows open / viewable at the same time. Just use the 'Split Terminal' control in the terminal window. So, you can have the two different consoles and bounce between them as needed.
So, all default native console stuff you do in one and all the ISE script output stuff, etc., in the other.
You must be logged in to reply to this topic.