What’s the Recommended Editor for PowerShell Scripts?

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.

I recently received a comment about my choice of editors for a particular project I was working on. This comment was from a third party and not Microsoft themselves.

“We do recommend using VSCode over the ISE whenever possible since it is the recommended tool by Microsoft.”

I was wondering if I’d missed an announcement so I decided to share this comment with Microsoft and my fellow MVP’s. While I didn’t receive any feedback from Microsoft, I did receive numerous messages back from other MVP’s and based on their comments, this message appears to be a bit strong and possibly within the context of development for PowerShell tooling. I also couldn’t find anything on Microsoft’s site confirming this statement.

The following is an except from “Announcing PowerShell for Visual Studio Code 1.0” on the PowerShell Team blog.


“What does this mean for the PowerShell ISE?

The PowerShell ISE has been the official editor for PowerShell throughout most of the history of Windows PowerShell. Now with the advent of the cross-platform PowerShell Core, we need a new official editor that’s available across all supported OS platforms and versions. Visual Studio Code is now that editor and the majority of our effort will be focused there.

However, the PowerShell ISE will remain in Windows supporting Windows PowerShell with no plans to remove it. We will consider investing effort there in the future if there is a high demand for it, but for now we think that we will be able to provide the best possible experience to the PowerShell community through Visual Studio Code.”


As you can see, the PowerShell ISE isn’t going anywhere. While there are numerous legitimate reasons to use VSCode instead of the ISE, if a Windows admin occasionally opens a script to edit it, there’s no reason they need to install VSCode. Many Windows admins would simply go back to the GUI if they were forced to install and use a product with Visual Studio in its name on day one of their scripting journey.

If you’re only running scripts, you don’t need the ISE or VSCode. Just run them in the PowerShell console. Nine out of ten times, when you find an intermediate level PowerShell scripter who doesn’t understand scoping, it’s because they never use the console.

If you’re like me and spend the majority of your day knee deep in PowerShell code, then I recommend taking the time to learn how to use VSCode (See my “How to install Visual Studio Code and configure it as a replacement for the PowerShell ISE” blog article and video), but you shouldn’t feel embarrassed if you’re an occasional scripter who uses the ISE.

µ

2 Comments

  1. Luke

    Hi Mike,
    I am glad that you came up with this subject.
    VSCode is a really awesome product and the community is doing a huge work on it.
    I use it every time I write some permanent scripts or modules.
    However, this is only one part of my work as a SysAdmin.
    In my day to day work, usually, I am connected to a bunch of servers via ISE remoting tabs (I use RDP connections only when I am obliged to).
    These tabs are also automatically named with the name of the remote computer, which is very important when you have a lot of them.
    And inside those tabs, I am doing a lot of stuff like managing AD users, groups, computers, or working on WSUS, PKI, SCOM, and so on.
    Those tabs are also linked to one or more scripting tabs under them.
    Like I said I don’t use them to write permanent scripts or module, but rather little one-shot scripts usually composed of foreach and invoke-command.
    Most of the time it’s just an easy way to split very long one-liner command-lines into several lines and make it more readable for myself. They are nearly never saved to a file.
    Furthermore, I can switch back and forth from the scripting tab to the console with CTRL + R and navigate between remoting tabs with ALT + TAB.
    I don’t have to switch between many PowerShell console with each one having a remoting session.
    They are all here before my eyes in one single ISE console with a bunch of remoting tabs with the name of the remote computer, each of these tabs being linked to one or several scripting tabs.
    This is so easy and efficient in ISE and it makes me so efficient too!
    I tried to do the same with VSCode…
    Unfortunately, and despite I installed the PowerShell extension and recently the Terminal tabs extension, doing a SysAdmin works is like a pain and I feel so inefficient.
    VSCode appears to me as a dev tool, with some funny ISE-like widgets, so that they can say: “Ok now VSCode is at iso features with ISE”.
    But this is not the case at all for the moment: it’s still not a SysAdmin tool.
    In VSCode you can have a lot of scripting tabs, but they are only linked to one single PowerShell Integrated Console (even if you open other terminal consoles).
    If I want to work on several servers simultaneously while using scripting tabs above I have to open one VSCode console per remoting session.
    Furthermore, there is no easy way to switch between the terminals like ALT + TAB in ISE.
    And worst of all, you have to rename them manually if you don’t want to have to try them all before finding the right one.
    Currently, the Terminal tabs extension is just good for demos, or for people who are working in labs with only on one or two servers simultaneously.
    But in real life when you have to administer several hundreds of servers, it just doesn’t make the job.
    I don’t want here to diminish the work of all those who are contributing to VSCode.
    Like I said it’s an awesome tool and I use it in very specific situations (in fact for PowerShell Dev) where VSCode is really better than ISE.
    However, for SysAdmin work, ISE is not dead and is still the most useful of both tools in this particular but very essential case.
    I hope that one day VSCode will catch up ISE with it’s PS Remoting capability.
    And then I can use one tool for both dev and SysAdmin work instead of constantly switching between them…
    VSCode has become my favorite tool when writing permanent scripts and modules.
    But PowerShell is all about SysAdmin (not Dev).
    And currently, ISE makes me really PowerFull when doing my SysAdmin work, while VSCode, unfortunately, does not.

    Reply
  2. shawn bequette (@shawnwat)

    I basically feel the same way as Luke about VSCode being a developer tool. I am attempting to increase my skill level in the developer arena so my scripts are more robust and portable, but some days you just need to get stuff done. I am a consultant which leads to the big reason i use ISE. I walk into a customer and write a script for what they asked for. We go to run the script in their environment and it doesn’t work. In most cases I can’t just install VSCode, so ISE it is for modifying and troubleshooting in the customer environment.

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: