0

In this post I found the way to detect the installed Powershell version: Determine installed PowerShell version.

When I type "powershell" into "Execute as" (Win+R) the powershell opens with the title:

C:\Windows\System32\WindowsPoershell\v1.0\powershell.exe

However, the commands from the linked SO question deliver following output:

powershell output

So my question: Why is there v1.0 in the title of the shell window whereas the other commands tell me that I have version 2?

Community
  • 1
  • 1
h0ch5tr4355
  • 2,092
  • 4
  • 28
  • 51
  • 2
    As the answers to the linked question say, you have v2 since $PSVersionTable works for you. Your question title is misleading as your actual question really has nothing to do with finding out what version you have. – DeanOC May 24 '16 at 06:43
  • @DeanOC you are right, I changed it to a maybe better title – h0ch5tr4355 May 24 '16 at 06:45

1 Answers1

2

Your PowerShell version is 2. The title shows the path to the PowerShell executeable. I think the reason why all new PowerShell version are located there (in v1.0) is because so many cmd scripts invoking some PowerShell code using this file path (e. g. Scheduled Tasks). But I may be wrong.

Another reason could be, that its not possible to run two different PowerShell Versions side-by-side.

Martin Brandl
  • 56,134
  • 13
  • 133
  • 172
  • 1
    Yes, `v1.0` in the filepath is for backwards comp. Lets not forget compiled code referencing it! :-) It was a bad idea for MS to version it since they wouldn't allow multiple version to be installed side-by-side (unlike .NET Framework). You have the same problem With the fileextenstions ps1, psd1, psm1 – Frode F. May 24 '16 at 10:48