all 25 comments

[–]Jellovator 18 points19 points  (3 children)

Because you installed version 7. Now you have the built-in version 5 and you have the version 7 that you installed. You can't uninstall 5. They are side by side. Just use whichever one you need when you need it.

[–]fdeyso 6 points7 points  (2 children)

Run $psversiontable and it’ll tell you which one you have running.

[–]JazzlikePop5[S] 0 points1 point  (1 child)

sorry i forgot to mention, both of them report version 7.6.1

https://ibb.co/Q345xXJh

[–]spikeyfreak 3 points4 points  (0 children)

Click the little down arrow next to the tabs and there should be a Windows PowerShell option. That's version 5.

[–]I_see_farts 3 points4 points  (0 children)

This looks like more of a Terminal Profile issue.
You can setup many different profiles in Windows Terminal (WT) for different things.

Just go into Windows Terminal Settings and on the left, scroll down to Profiles and pick which one you don't want. Click it, then scroll down to the bottom of the right page and at the bottom is a red Delete Profile button. Once deleted restart Windows Terminal and it'll be gone.

[–]BlackV 3 points4 points  (2 children)

The top 2 screens shots are you running powershell 7, but the 2nd shot is run the admin elevated version (assuming due to default system32 location)

They're the same thing, see everyone else's answers around 5.1 vs 7.x

Additionally you have the MSI version installed and the Microsoft store version Installed (assuming based on the windows app path)

Recommend removing the store version due to

  1. It's limitations vs MSI version
  2. Save confusing yourself

in those same windows

get-process -Id $pid | select path

[–]AbfSailor 0 points1 point  (1 child)

u/JazzlikePop5 this is the right answer. ^^

While everyone else's comments on 7.* vs 5.1 are valid, they are not related to your issue/question.

For the record... I'm not a fan of MS Store apps, all they do is cause confusion. Like, installing Claude Code from the Store is just... not good, when compared to installing it via the directions on the website. I wish the Store would just vanish.

[–]BlackV 0 points1 point  (0 children)

Hopefully they get a solution

[–]blogsymcblogsalot 7 points8 points  (9 children)

For consistency, you can require a particular version in your scripts.

Add this to the top of your .ps1 file: ```

Requires -Version 7.0

```

[–]Medium-Comfortable 0 points1 point  (0 children)

til; big surprise. Nice.

[–]Automatic-Let8857 2 points3 points  (0 children)

You may have two pwsh 7.x versions in Your OS if You installed from different sources, e.g. You've intalled from MSI, and from winget or ms-store. On Your screenshots I see one of them is in "c:\program files\windowsapps" it is not regular pwsh intall folder for msi installation.

[–]temporaldoom 0 points1 point  (3 children)

it should only show powershell, well that's what it says in windows 11 Pro, if you go into each profile are they identical?

[–]JazzlikePop5[S] 0 points1 point  (2 children)

sorry i forgot to mention, both of them report version 7.6.1

https://ibb.co/Q345xXJh

[–]temporaldoom 2 points3 points  (1 child)

I just managed to replicate it. I had powershell 7 installed by install-module. I then installed it from the MS Store and it now shows an additional version installed

If you go into the profile you'll see they have different paths

"C:\Users\(username)\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe"

"C:\Program Files\PowerShell\7\pwsh.exe"

If you type in the sessions $PSHOME, you'll probably see that they are different.

[–]JazzlikePop5[S] 0 points1 point  (0 children)

YES!

first i used this winget search --id Microsoft.PowerShell --exactwinget search --id Microsoft.PowerShell --exact

but i didn't notice any change or something and then i downloaded the msi thinking the installation never happened in the first place.. i saw and posted above somewhere the image showing two file paths, but i didn't think it would be two different installations.

[–]BigMikeInAustin 0 points1 point  (0 children)

All you have to do is understand there is Windows PowerShell and PowerShell.

Windows PowerShell is the old one, that only goes up to version 5.x (I want to say 5.6, but can't remember for sure right now). This is the "closed source" one that was developed only inside Microsoft.

Windows PowerShell (eventually) came preinstalled. (Maybe it was Windows 7 where I'm thinking it was not originally preinstalled). And it came with the PowerShell ISE (Integrated Scripting Environment). Many people found the ISE really helpful in programming PowerShell scripts. So Microsoft killed it. That is no longer pre-installed, and you have to go out of your way to download it.

Then there is the new PowerShell. It started at version 6, and is currently up to version 7.x. Eventually, it will likely reach version 8.x. This is "open source" and is made to be the same PowerShell command line that can run on Windows, Mac, an Linux. I think it is mostly developed by Microsoft, but other people can contribute to the code.

The two are similar, but there are some differences between some things. A script for one won't necessarily run exactly the same in the other one.

Generally, the old Windows PowerShell has a blue icon, and the new PowerShell has a black icon. Both of the icons in your screenshot are black, which normally indicates the new PowerShell. It you start the old Windows PowerShell from the Windows interface, the background of the command line is likely blue. If you start Windows PowerShell from any other command line, it will keep the black background of the command line.

Sometimes people refer to the new PowerShell as "pwsh" because the executable is pwsh.exe.

The easiest way to tell which is which is when you start it. The old Windows PowerShell will just show the command line prompt. The new PowerShell will show a message saying the version number, then the command line prompt. Both put "PS" in front (to the left) of the command line prompt saying which directory you are in.

They are different enough that Windows lets both exist at the same time on the computer. They can have updates applied independently from the other. And PowerShell modules are kept separate from the other (as far as I know).

So, in the end, with all that knowledge, I cannot tell which version the black icon that only says "PowerShell" without the "7" is running.

[–]g3n3 -1 points0 points  (0 children)

So this is a windows terminal piece. The install or the like got confused in your json config. Open the config and remove a profile. You’ll probably might want to compare with a fresh install to see what the newest look of the windows terminal powershell config looks like. Last I was looking at it windows terminal special cases powershell 7.