Search code examples
powershellversioning

PowerShell installation folder and script filename extension across versions


Wikipedia says that PowerShell 2.0 was distributed with Windows 7; so as I use Windows 7, I'm obviously using that version.

But that raises two questions:

  1. Why is PowerShell's folder C:\Windows\System32\WindowsPowerShell\v1.0 with that trailing v1.0 when it actually should be v2.0?
  2. Why is the PowerShell script extension .ps1? Will that extension increment when the version changes?

Solution

  • This is simply the result of a choice made by the Powershell team. They decided to keep both the 1.0 directory and the .ps1 extension for V2 of powershell.

    The best way to actually check the version of Powershell is to use the expression $PSVersionTable.PSVersion

    C:\Users\jaredpar> $PSVersionTable.PSVersion
    
    Major  Minor  Build  Revision
    -----  -----  -----  --------
    2      0      -1     -1