Using PowerGUI with PowerShell 5 and 7

PowerShell PowerGUI

May 30, 2020

quote Discuss this Article

What is PowerGUI?

PowerGUI is a comprehensive solution helping you get the most of Windows PowerShell. The product has two components:

PowerGUI Administrative Console is designed to:

Streamline PowerShell-based administration tasks by providing ready-made tools through a unified interface Make the extensive capabilities of PowerShell accessible to users who are not comfortable with the text console environment Help establish administration tiers by making specific tools available to specific groups of users, such as Active Directory administrators, help desk staff, and end users

Using PowerGUI with Modern Versions of PowerShell

This is a blast from the past. PowerGUI 3.8 was released in 2013. I worked for Quest at the time PowerGUI was in its prime and have some fond memories as it. PowerShell Tools for Visual Studio even started out as PowerGUI VSX. I decided to give it a go to see if I could run Windows PowerShell 5.1 and PowerShell 7 in PowerGUI. Let’s just say, success.

Running PowerShell 7 inside PowerGUI is actually not possible. PowerShell 7 runs on .NET core while PowerGUI seems to be built on .NET Framework 2.0ish. That said, you can create a local pwsh.exe process and use named pipe remoting to accomplish the debugging. This is similar to the technique for running PowerShell 7 in the Windows PowerShell ISE.

Installing PowerGUI on Modern Operating Systems

First, you won’t find this MSI on the Quest website anywhere. I downloaded this from the somewhat sketchy Softpedia. Once you download it, you’ll need to make a couple of registry tweaks to allow the installer to complete. This is because PowerGUI is trying to ensure the Windows PowerShell 2.0 is installed. I bet if you installed the Windows PowerShell 2.0 Windows Feature, you wouldn’t have to do this. I decided not to do that. Here are the keys I added.

New-Item HKLM:\SOFTWARE\Microsoft\Powershell\1\PowerShellEngine
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Powershell\1\PowerShellEngine -Name 'PowerShellVersion' -Value '5.1'

Once those keys are created, you’ll be able to make it through the PowerGUI installer and PowerGUI will (hopefully) open up right after completing the install. Amazingly, IntelliSense, execution,and even debugging works.

What’s almost just as exciting is that the PowerGUI Administrative Console works. This means that you can load up some PowerPacks and start futzing around with providers.

I wanted to see if I could take it to the next level so I tried to load up pwsh.exe and use a named pipe remoting runspace and sure enough, you can execute PowerShell 7 from PowerGUI. What a time to be alive.