If you do any amount of PowerShell scripting you have most likely heard about Visual Studio Code. This is a free cross-platform light-weight editor from Microsoft. VS Code supports multiple languages and is extensible. I've tried different versions since it was first released but never found a reason to jump from the PowerShell ISE. For my purposes the ISE works just fine plus I've customized it so much that it would be hard to abandon. But there is a new version of VS Code that is at least making it more tempting.
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
The May 2016 release of VS Code (v1.2.0) now includes an integrated terminal. You've always been able to launch a CMD or even a PowerShell session but it was completely separate. Now the terminal is integrated into the product.
The terminal extension is far from feature complete but definitely a step in the right direction. For example, you can paste into it but you can't copy out of it. There's no F8 or F5 equivalents like there is in the PowerShell ISE. But it is a full PowerShell console. You can do remoting, import modules, even change console colors.
To access the terminal you use the Ctrl+` key combination. I wasn't sure I'd like that combo but at least on my keyboard it is an easy one to make. By default on Windows machines you'll get a CMD session. From there you could start PowerShell. Or you can modify your personal settings. In VS Code go to File - Preference - User Settings. Insert this line:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
It should be inside a set of curly braces. If you have multiple settings, they need to be separated by commas.
Did you notice the sysnative folder reference? If you try to do a directory listing you won't see it. It is a virtual folder in Windows. But this is the trick, especially if you are running an x64 desktop, which I assume most of you are. Because VS Code on Windows is still a 32-bit app, if you used a line this like:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
You would get the 32-bit PowerShell session.
That's certainly not what I wanted which is why I'm referencing the SysNative virtual folder.
When the PowerShell session opens, it will run all of your profile scripts. Now, even though there is a VS Code setting to disable PowerShell profiles, it doesn't apply to this terminal as it is a new process. Personally, in VS Code, I didn't want any of my profile scripts to run because I wanted a clean session to test code and commands from VS Code. Since you can't add any parameters to the shell parameter, I devised this work around.
I wrote a simple batch CMD batch file.
::startps.bat @echo off c:\windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -nologo -noprofile
I then modified the user settings to launch it.
"terminal.integrated.shell.windows": "c:\\scripts\\startps.bat"
Now I get the PowerShell terminal I want.
I'll have more about my experiences with VS Code as a PowerShell development tool. The team realizes there is much more work to do and I look forward to their efforts. In the meantime I'd love to hear about your experiences and impressions.