Introducing the PowerShell Version Selector

Testing can be a chore if you develop DevOps solutions with PowerShell 7. After all, there seem to be new versions frequently; some are Long Term Support (LTS), while others disappear from use quickly. So regardless of status, whatever environment you are managing, you probably need to test against various versions.

At a minimum, you likely want to test with:

  • PowerShell 7.0.8 using .NET 3.1
  • PowerShell 7.1.5 using .NET 5
  • PowerShell 7.2.1 using .NET 6

and maybe some in between.

The installers for PowerShell 7 all install in the same folder. Yes, there is a dialog to install it into a different folder, but then PowerShell is no longer where every other software or module expects it to be. The installers also do not allow you to replace a newer version with an older one—first, you need to uninstall.

The new PowerShell Version Selector just makes it a little easier to toggle the current PowerShell 7 version. You can find it on PrimalScript 2022’s ribbon (8.0.161 or later).

image

The tool itself is pretty straightforward:

  • Check a new version to uninstall the current one and install the selected one.
  • Uncheck the current one to uninstall it.

An internet connection is required to download the PowerShell installers from GitHub.

image

You can install and uninstall as you please and run a shell in between if you need a quick test before moving on to another version.

The PowerShell installers are not hidden but are set to provide a minimum user interface. That makes it easier to see details when something goes wrong or takes longer than expected.

If a new PowerShell 7 version appears, just add the version to the list. The tool will find the download and install or uninstall it for you.

image

Feedback

Questions or ideas for improvement? Please do not hesitate to leave a comment below.