If you write a lot of Windows PowerShell code, you’re quite likely using the Windows PowerShell Integrated Scripting Editor (ISE). This editor has been included out-of-box ever since Windows 7, when PowerShell version 2.0 was introduced. Although there are some more modernized options for PowerShell editors and debuggers out there, such as the Visual Studio extension or the lightweight, cross-platform Visual Studio Code editor, you’ll often find yourself coming back to the native, friendly ISE environment. One of the nice things about the PowerShell ISE is that it supports custom themes. While PowerShell ISE themes don’t offer a functional improvement to your environment, they do at least provide a fresh appearance for you to work in. If you change your theme on a regular basis, you might find that your overall enjoyment of PowerShell development improves!
The one challenge that users of PowerShell ISE have faced, for some years now, is the rapid installation of PowerShell ISE themes. I frequently find myself using different Windows systems, and I don’t always have consistency between the environments. Importing themes for ISE has been a manual process, because the PowerShell ISE doesn’t have any native commands to install themes.
To solve for this challenge, Art of Shell wrote a PowerShell module called ISEThemes, and uploaded it to the PowerShell Gallery. This module is free for commercial and non-commercial use, and is licensed under the common MIT open source license! Using the ISEThemes module is very easy, because it only has a single command called Import-ISETheme. This command even supports pipelining! To use the command, simply issue a command, similar to the following:
### Install the ISEThemes PowerShell module Install-Module -Name ISEThemes -Scope CurrentUser -Force ### Obtain a list of theme files (*.ps1xml files) from a download folder $ThemeList = Get-ChildItem -Path c:\users\ArtofShell\Downloads -Recurse -File -Include *.ps1xml ### Import the themes into the PowerShell ISE $ThemeList | Import-ISETheme
The Import-ISETheme command doesn’t require administrative permissions, so you can run it as a non-admin standard user. Furthermore, the Import-ISETheme command can be executed from any PowerShell host, including the PowerShell Console Host, the ISE, Microsoft Visual Studio Code, or Microsoft Visual Studio. We hope that you enjoy this new PowerShell module! Tell all your friends and coworkers about it, so they can enjoy its benefits! Don’t forget to change you PowerShell ISE themes once in a while!