olly - Fotolia

Microsoft's VS Code embrace prompts PowerShell editor debate

IT admins can build scripts with PowerShell ISE, VS Code or PowerShell Studio. Think about what platforms and functions you need before deciding which is right for you.

Windows admins who write scripts with PowerShell ISE must switch allegiances if Microsoft has its way.

Since 2009, Microsoft has positioned the PowerShell Integrated Scripting Environment (ISE) as the official PowerShell editor to develop and debug scripts on Windows. But Microsoft's effort to steer Windows, Linux and macOS users to PowerShell Core as an all-encompassing management tool requires a script editor that works on all those systems.

In May 2017, Microsoft named a new official PowerShell editor: Visual Studio Code (VS Code), a free, open source editor with a PowerShell extension so admins on multiple platforms can build PowerShell scripts. Microsoft continues to support PowerShell ISE for now but plans to focus development efforts on VS Code.

For IT engineers who code in multiple languages, VS Code is the recommended tool. It's also a better tool even for people who only write PowerShell scripts and modules, said Jeffery Hicks, IT author and trainer.

"It's the future," he said. "ISE will no longer get improvements; we're not going to see updates to it. What we have now is what we're always going to have. VS Code is going to be continually updated, and they'll fix bugs."

Microsoft continues to support PowerShell ISE for now but plans to focus development efforts on VS Code.

While VS Code might be the future of PowerShell development, not everyone thinks it's ready for prime time.

Jeff Wilson, an IT admin based in Los Angeles who works in a Windows shop, experiments with VS Code to learn how it works but quickly noticed it lacked some of PowerShell ISE's functionality. ISE uses default profiles to let Wilson access all his administrative sessions -- such as Exchange Online, SharePoint and Hyper-V clusters -- without delay.

"It's a huge time-saver, and it's really valuable to me," he said. "It's the famous single pane of glass because it's so flexible. So with VS Code, when I installed it, I wanted to duplicate the experience I had with ISE. ... It wasn't immediately evident to me how I would do that. That's problematic, but [at least] I still have ISE."

Expect a bumpy transition to VS Code

PowerShell ISE veterans such as Wilson will need time to adapt to the different layout and terminology in VS Code.

Admins use the integrated PowerShell console in PowerShell ISE to access menu items and keyboard shortcuts. With the integrated console, admins see the output as they write scripts. The console in VS Code needs work, Hicks said.

"The PowerShell integrated terminal that is shipping in VS Code now is not quite as feature-complete as it is in the ISE," he said. "It's still a little buggy, and it doesn't quite feel the way you want it to. I have muscle memory [from PowerShell ISE], so when I do presentations, I still typically use PowerShell ISE because I can toggle between the code and the presentation on the full screen. I can't really do that in VS Code."

Despite these shortcomings, Hicks recommends admins move to VS Code as their PowerShell editor for its integration with the Git code management system and ability to auto-format code to make it easier to read.

PowerShell Studio gives scripts a GUI

For IT pros who want more advanced features from a PowerShell editor, a commercial product such as PowerShell Studio is another option.

Wilson builds front ends to his scripts with PowerShell Studio for his company's help desk workers who want a point-and-click UI.

PowerShell Studio, which is a Sapien product, is Windows only, although Sapien also offers iPowerShell, a pared-down and free tool that's designed for Mac, Android and iOS users who write scripts remotely. Additionally, Sapien's PrimalScript product is compatible with PowerShell Core.

For Hicks -- a former Sapien employee -- one of the editor's big selling points is that it builds a GUI on a PowerShell script, which isn't possible in PowerShell ISE or VS Code. Admins can also use PowerShell Studio to export scripts as executable files, easily create modules, build advanced functions with multiple parameters, and auto-generate comment-based help for existing functions.

Wilson writes longer scripts and complex functions in PowerShell Studio, which he calls a more fully thought-out developing environment than ISE or VS Code. It also features a way to add a layer of security to the finished script.

"I always sign my scripts with a digital certificate and [PowerShell Studio] makes it easier to do," Wilson said.

There's a cost to this feature richness; a one-year subscription to PowerShell Studio 2017 is $389.

"If you don't need 90% of the features, maybe it's not worth your time and money," he said. "But if that one feature Sapien offers [in PowerShell Studio] saves you a lot of time and money, then it's worth it."

Dan Cagen is the associate site editor for SearchWindowsServer.com. Write to him at [email protected].

Next Steps

More on the PowerShell ISE, VS Code debate

Microsoft brings server products into Linux

Time for Windows Server admins to learn Linux

Dig Deeper on Windows systems and network management