Ever wonder how VSCode (Visual Studio Code) maintains those untitled tabs between sessions? They’re stored as files underneath your user’s profile in appdata on Windows based systems as shown in the following example. Get-ChildItem -Path $env:APPDATA\Code\Backups\*\untitled -Recurse The previous command could be piped to Get-Content to view the contents of all of code in the open untitled tabs of VSCode. You could also use Select-String to find something specific. I can see that three of my open tabs contain ‘mikefrobbins’.
I’m using VSCode for all of my PowerShell development at this point. I reloaded my system from scratch on March 13th of this year. Yesterday was the first time I’ve opened the PowerShell ISE since then and it was only to determine if something worked differently between the two (I tweeted this out yesterday). One of the common problems I hear about and have experienced myself with VSCode (Visual Studio Code) is that tabbed expansion of command and parameter names doesn’t work like it does in the ISE (Integrated Scripting Environment).
Earlier this year, I watched a recording of the January 2019 Arizona PowerShell User Group meeting where Tim Warner presented a session on Easing your transition from the PowerShell ISE to Visual Studio Code. One of the things Tim demonstrated was a VSCode extension named Settings Sync where you can synchronize your VSCode settings to and from a GitHub Gist. While it seems to be designed to synchronize your settings between multiple computers, I recently found out that it can also be a lifesaver even if you only use it on one computer.
You’ve probably heard, as I have, that Visual Studio Code (VSCode) is the latest whiz-bang editor that you should be using for PowerShell (and I am for development of PowerShell code on my primary workstation). One word of caution though is to make sure to put things into perspective and not be so quick to shun people away from using the PowerShell Integrated Scripting Environment (ISE), depending on how they’re using it.
Today, David Wilson from the PowerShell team at Microsoft, announced that Regions are now available in VSCode (Visual Studio Code) as of insiders build version 1.17.0. I was hoping the region and endregion keywords would be case-insensitive unlike in the PowerShell ISE where they’re case-sensitive. It looks like that’s indeed what they intended since the region keyword is case-insensitive in VSCode, but unfortunately the endregion keyword is case-sensitive as shown in the following example.
If you follow me on Twitter,then I’m sure you’re aware that I’ve been using nothing but VS Code (Visual Studio Code) as a replacement for the PowerShell ISE (Integrated Scripting Environment) for the past couple of weeks and while I had tried it in the past, I didn’t previously think it was ready for prime time. That’s now changed with all of the updates and work that has gone into it.
I recently discovered a rendering problem in VS Code where pressing escape doesn’t delete a multi-line command in the PowerShell integrated terminal. I created a videoto report the problem and I thought I would share it here since the quality was less than optimal when sharing it on Twitter. Here’s a link to my original tweetto David Wilsonand here’s a link to the GitHub issuethat Max Trinidadhas created. µ