Why am I seeing multiple PowerShell profiles and versions in Windows Terminal?

0
0
Asked By MellowQuartz42 On

I installed PowerShell 7 to test some commands while troubleshooting a Start menu issue. Windows Terminal now shows multiple PowerShell entries, and I'm trying to understand whether they are different PowerShell versions or duplicate installations. Both entries appear to report PowerShell 7.6.1, but one seems to use a path under WindowsApps. I originally installed PowerShell with winget and then also ran the MSI installer because I thought the first installation had not worked. What is the difference between these entries, and which installation should I keep?

3 Answers

Answered By TidyHarbor61 On

Your screenshots may be showing duplicate Windows Terminal profiles rather than two different PowerShell releases. Terminal can create separate profiles for installations from different sources, such as winget, the Microsoft Store, and the MSI package. Open Terminal settings, compare the profile command lines and paths, and delete the duplicate profile you do not want. Since you installed PowerShell through winget and then with the MSI, removing the extra installation should leave one PowerShell 7 profile alongside the built-in Windows PowerShell 5.1.

AmberKite503 -

If both entries report 7.6.1, they are not 5.1 versus 7; they are most likely two PowerShell 7 installations or two profiles pointing to the same version.

Answered By PlainRiver16 On

Windows PowerShell 5.1 and modern PowerShell 7 are different products. The older one is Windows-only and included with the operating system, while PowerShell 7 is newer, open source, and designed to work across Windows, macOS, and Linux. Scripts and modules are often compatible, but not always, so it is normal for both versions to remain installed. You can require a script to run on PowerShell 7 by adding #Requires -Version 7.0 at the top of the .ps1 file.

Answered By CedarMoth8 On

There are two separate things here. Windows PowerShell 5.1 is built into Windows and remains installed, while PowerShell 7 is the newer, separately installed version. They can coexist and are launched with different executables: powershell.exe for 5.1 and pwsh.exe for 7.x. You can check the version of the session you currently have open with $PSVersionTable.

OrbitingNora27 -

Also check the executable path with Get-Process -Id $PID | Select-Object Path. That helps distinguish a normal MSI installation from a WindowsApps or Store-based installation.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

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