PowerShell installation folder and script filename extension across versionsDetermine installed PowerShell versionHow to run a PowerShell scriptHomebrew install specific version of formula?PowerShell says “execution of scripts is disabled on this system.”Path to Powershell.exe (v 2.0)Why is Powershell 2.0 installed in the same location as Powershell 1.0?Where is the v2.0 and v3.0 folder for PowerShell?Powershell script can't find module when run via -File paramHow do I run a PowerShell script when the computer starts?PowerShell: Run script from shortcut using relative path

Placing text inside a loop

How to trigger Authentification of Named Credential created via Apex

Switching interface VLAN ID Mid-Production

Why did Harry Potter get a bedroom?

Salt, pepper, herbs and spices

Would a non-attacking Barbarian's rage end the same turn he started it?

Does throwing a penny at a train stop the train?

Is there any reason why MCU changed the Snap to Blip

How to deal with moral/legal subjects in writing?

Is "De qui parles-tu" (for example) as formal as it is in English, or is it normal for the French to casually say that

How can I effectively communicate to recruiters that a phone call is not possible?

Is there a strong legal guarantee that the U.S. can give to another country that it won't attack them?

Integer Lists of Noah

If your plane is out-of-control, why does military training instruct releasing the joystick to neutralize controls?

OR-backed serious games

Is there any word for "disobedience to God"?

Is "I do not want you to go nowhere" a case of "DOUBLE-NEGATIVES" as claimed by Grammarly?

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?

How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?

Which star / galaxy is moving away from us the fastest?

How can a dictatorship government be beneficial to a dictator in a post-scarcity society?

Astronaut distance from Earth?

How do native German speakers usually express skepticism (using even) about a premise?

What is this little owl-like bird?



PowerShell installation folder and script filename extension across versions


Determine installed PowerShell versionHow to run a PowerShell scriptHomebrew install specific version of formula?PowerShell says “execution of scripts is disabled on this system.”Path to Powershell.exe (v 2.0)Why is Powershell 2.0 installed in the same location as Powershell 1.0?Where is the v2.0 and v3.0 folder for PowerShell?Powershell script can't find module when run via -File paramHow do I run a PowerShell script when the computer starts?PowerShell: Run script from shortcut using relative path






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















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:WindowsSystem32WindowsPowerShellv1.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?









share|improve this question






























    4















    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:WindowsSystem32WindowsPowerShellv1.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?









    share|improve this question


























      4












      4








      4


      1






      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:WindowsSystem32WindowsPowerShellv1.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?









      share|improve this question
















      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:WindowsSystem32WindowsPowerShellv1.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?






      powershell versioning






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 6 '17 at 4:38









      mklement0

      149k25 gold badges271 silver badges304 bronze badges




      149k25 gold badges271 silver badges304 bronze badges










      asked Nov 23 '10 at 18:02









      pokepoke

      227k50 gold badges355 silver badges417 bronze badges




      227k50 gold badges355 silver badges417 bronze badges






















          2 Answers
          2






          active

          oldest

          votes


















          2














          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:Usersjaredpar> $PSVersionTable.PSVersion

          Major Minor Build Revision
          ----- ----- ----- --------
          2 0 -1 -1





          share|improve this answer






























            1














            This is an ancient blog post (2007), but it still applies; in short:




            • As long as new PowerShell versions remain backward-compatible, they will replace earlier versions:



              • The installation location, reflected in $PSHOME - $env:systemrootSystem32WindowsPowerShellv1.0 - will remain the same.


              • The filename extension - .ps1 - will remain the same.



            • Scripts created for an earlier version will continue to run.


            • To mark a script as requiring version <n> at a minimum , use #requires -version <n> at the top of the script (technically, it can be placed anywhere in the script, but it makes sense sense to place it at the top).


            In Windows PowerShell, backward compatibility has been maintained since v1 (current is v5.1 as of this writing - likely the last major version; see below), so both the installation location and the filename extension have remained the same.



            However, all future effort will go toward the separate, cross-platform PowerShell Core edition, which - as of v6.2.0 - is largely backward-compatible with Windows PowerShell, though its use of .NET Core as the foundation means that certain Windows-specific technologies are fundamentally unavailable - see this blog post.




            To get the current session's PowerShell version:



            PS> [string] $PSVersionTable.PSVersion
            5.1.14393.693 # PSv5.1 example


            More generally, hashtable $PSVersionTable, introduced in v2, contains several pieces of version information, (incompletely) described in Get-Help about_Automatic_Variables; WinPS below refers to Windows PowerShell, whereas PSCore refers to PowerShell Core:



            Shared properties:



            Name Value 
            ---- -----
            PSVersion 5.1.14393.693 # The PowerShell version.
            PSEdition Desktop # 'Desktop'=WinPS; 'Core'=PSCore
            PSCompatibleVersions 1.0, 2.0, 3.0, 4.0... # array of compatible versions
            WSManStackVersion 3.0 # WS-Management (WinRM) version
            PSRemotingProtocolVersion 2.3 # remoting-protocol version
            SerializationVersion 1.1.0.1 # serialization-protocol version


            Additional properties exclusive to WinPS:



            BuildVersion 10.0.14393.693 # ?? Highest supported OS major.minor version, seemingly followed by the build.revision PS version.
            CLRVersion 4.0.30319.42000 # The .NET Framework CLR version


            Additional properties exclusive to PSCore:



            GitCommitId 6.2.0 # The Git commit ID reflecting an RTM tag (e.g., 6.2.0), release tag (e.g., 6.2.0-rc.1) or a specific non-release commit (e.g., 6.2.0-preview.4-108-g5d54f1aa3871a826409496437e25856dc263ccc4)
            OS Microsoft Windows 10.0.17134 # [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
            Platform Win32NT # [System.Environment]::OSVersion.Platform





            share|improve this answer



























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4259241%2fpowershell-installation-folder-and-script-filename-extension-across-versions%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              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:Usersjaredpar> $PSVersionTable.PSVersion

              Major Minor Build Revision
              ----- ----- ----- --------
              2 0 -1 -1





              share|improve this answer



























                2














                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:Usersjaredpar> $PSVersionTable.PSVersion

                Major Minor Build Revision
                ----- ----- ----- --------
                2 0 -1 -1





                share|improve this answer

























                  2












                  2








                  2







                  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:Usersjaredpar> $PSVersionTable.PSVersion

                  Major Minor Build Revision
                  ----- ----- ----- --------
                  2 0 -1 -1





                  share|improve this answer













                  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:Usersjaredpar> $PSVersionTable.PSVersion

                  Major Minor Build Revision
                  ----- ----- ----- --------
                  2 0 -1 -1






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 23 '10 at 18:09









                  JaredParJaredPar

                  594k124 gold badges1098 silver badges1362 bronze badges




                  594k124 gold badges1098 silver badges1362 bronze badges























                      1














                      This is an ancient blog post (2007), but it still applies; in short:




                      • As long as new PowerShell versions remain backward-compatible, they will replace earlier versions:



                        • The installation location, reflected in $PSHOME - $env:systemrootSystem32WindowsPowerShellv1.0 - will remain the same.


                        • The filename extension - .ps1 - will remain the same.



                      • Scripts created for an earlier version will continue to run.


                      • To mark a script as requiring version <n> at a minimum , use #requires -version <n> at the top of the script (technically, it can be placed anywhere in the script, but it makes sense sense to place it at the top).


                      In Windows PowerShell, backward compatibility has been maintained since v1 (current is v5.1 as of this writing - likely the last major version; see below), so both the installation location and the filename extension have remained the same.



                      However, all future effort will go toward the separate, cross-platform PowerShell Core edition, which - as of v6.2.0 - is largely backward-compatible with Windows PowerShell, though its use of .NET Core as the foundation means that certain Windows-specific technologies are fundamentally unavailable - see this blog post.




                      To get the current session's PowerShell version:



                      PS> [string] $PSVersionTable.PSVersion
                      5.1.14393.693 # PSv5.1 example


                      More generally, hashtable $PSVersionTable, introduced in v2, contains several pieces of version information, (incompletely) described in Get-Help about_Automatic_Variables; WinPS below refers to Windows PowerShell, whereas PSCore refers to PowerShell Core:



                      Shared properties:



                      Name Value 
                      ---- -----
                      PSVersion 5.1.14393.693 # The PowerShell version.
                      PSEdition Desktop # 'Desktop'=WinPS; 'Core'=PSCore
                      PSCompatibleVersions 1.0, 2.0, 3.0, 4.0... # array of compatible versions
                      WSManStackVersion 3.0 # WS-Management (WinRM) version
                      PSRemotingProtocolVersion 2.3 # remoting-protocol version
                      SerializationVersion 1.1.0.1 # serialization-protocol version


                      Additional properties exclusive to WinPS:



                      BuildVersion 10.0.14393.693 # ?? Highest supported OS major.minor version, seemingly followed by the build.revision PS version.
                      CLRVersion 4.0.30319.42000 # The .NET Framework CLR version


                      Additional properties exclusive to PSCore:



                      GitCommitId 6.2.0 # The Git commit ID reflecting an RTM tag (e.g., 6.2.0), release tag (e.g., 6.2.0-rc.1) or a specific non-release commit (e.g., 6.2.0-preview.4-108-g5d54f1aa3871a826409496437e25856dc263ccc4)
                      OS Microsoft Windows 10.0.17134 # [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
                      Platform Win32NT # [System.Environment]::OSVersion.Platform





                      share|improve this answer





























                        1














                        This is an ancient blog post (2007), but it still applies; in short:




                        • As long as new PowerShell versions remain backward-compatible, they will replace earlier versions:



                          • The installation location, reflected in $PSHOME - $env:systemrootSystem32WindowsPowerShellv1.0 - will remain the same.


                          • The filename extension - .ps1 - will remain the same.



                        • Scripts created for an earlier version will continue to run.


                        • To mark a script as requiring version <n> at a minimum , use #requires -version <n> at the top of the script (technically, it can be placed anywhere in the script, but it makes sense sense to place it at the top).


                        In Windows PowerShell, backward compatibility has been maintained since v1 (current is v5.1 as of this writing - likely the last major version; see below), so both the installation location and the filename extension have remained the same.



                        However, all future effort will go toward the separate, cross-platform PowerShell Core edition, which - as of v6.2.0 - is largely backward-compatible with Windows PowerShell, though its use of .NET Core as the foundation means that certain Windows-specific technologies are fundamentally unavailable - see this blog post.




                        To get the current session's PowerShell version:



                        PS> [string] $PSVersionTable.PSVersion
                        5.1.14393.693 # PSv5.1 example


                        More generally, hashtable $PSVersionTable, introduced in v2, contains several pieces of version information, (incompletely) described in Get-Help about_Automatic_Variables; WinPS below refers to Windows PowerShell, whereas PSCore refers to PowerShell Core:



                        Shared properties:



                        Name Value 
                        ---- -----
                        PSVersion 5.1.14393.693 # The PowerShell version.
                        PSEdition Desktop # 'Desktop'=WinPS; 'Core'=PSCore
                        PSCompatibleVersions 1.0, 2.0, 3.0, 4.0... # array of compatible versions
                        WSManStackVersion 3.0 # WS-Management (WinRM) version
                        PSRemotingProtocolVersion 2.3 # remoting-protocol version
                        SerializationVersion 1.1.0.1 # serialization-protocol version


                        Additional properties exclusive to WinPS:



                        BuildVersion 10.0.14393.693 # ?? Highest supported OS major.minor version, seemingly followed by the build.revision PS version.
                        CLRVersion 4.0.30319.42000 # The .NET Framework CLR version


                        Additional properties exclusive to PSCore:



                        GitCommitId 6.2.0 # The Git commit ID reflecting an RTM tag (e.g., 6.2.0), release tag (e.g., 6.2.0-rc.1) or a specific non-release commit (e.g., 6.2.0-preview.4-108-g5d54f1aa3871a826409496437e25856dc263ccc4)
                        OS Microsoft Windows 10.0.17134 # [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
                        Platform Win32NT # [System.Environment]::OSVersion.Platform





                        share|improve this answer



























                          1












                          1








                          1







                          This is an ancient blog post (2007), but it still applies; in short:




                          • As long as new PowerShell versions remain backward-compatible, they will replace earlier versions:



                            • The installation location, reflected in $PSHOME - $env:systemrootSystem32WindowsPowerShellv1.0 - will remain the same.


                            • The filename extension - .ps1 - will remain the same.



                          • Scripts created for an earlier version will continue to run.


                          • To mark a script as requiring version <n> at a minimum , use #requires -version <n> at the top of the script (technically, it can be placed anywhere in the script, but it makes sense sense to place it at the top).


                          In Windows PowerShell, backward compatibility has been maintained since v1 (current is v5.1 as of this writing - likely the last major version; see below), so both the installation location and the filename extension have remained the same.



                          However, all future effort will go toward the separate, cross-platform PowerShell Core edition, which - as of v6.2.0 - is largely backward-compatible with Windows PowerShell, though its use of .NET Core as the foundation means that certain Windows-specific technologies are fundamentally unavailable - see this blog post.




                          To get the current session's PowerShell version:



                          PS> [string] $PSVersionTable.PSVersion
                          5.1.14393.693 # PSv5.1 example


                          More generally, hashtable $PSVersionTable, introduced in v2, contains several pieces of version information, (incompletely) described in Get-Help about_Automatic_Variables; WinPS below refers to Windows PowerShell, whereas PSCore refers to PowerShell Core:



                          Shared properties:



                          Name Value 
                          ---- -----
                          PSVersion 5.1.14393.693 # The PowerShell version.
                          PSEdition Desktop # 'Desktop'=WinPS; 'Core'=PSCore
                          PSCompatibleVersions 1.0, 2.0, 3.0, 4.0... # array of compatible versions
                          WSManStackVersion 3.0 # WS-Management (WinRM) version
                          PSRemotingProtocolVersion 2.3 # remoting-protocol version
                          SerializationVersion 1.1.0.1 # serialization-protocol version


                          Additional properties exclusive to WinPS:



                          BuildVersion 10.0.14393.693 # ?? Highest supported OS major.minor version, seemingly followed by the build.revision PS version.
                          CLRVersion 4.0.30319.42000 # The .NET Framework CLR version


                          Additional properties exclusive to PSCore:



                          GitCommitId 6.2.0 # The Git commit ID reflecting an RTM tag (e.g., 6.2.0), release tag (e.g., 6.2.0-rc.1) or a specific non-release commit (e.g., 6.2.0-preview.4-108-g5d54f1aa3871a826409496437e25856dc263ccc4)
                          OS Microsoft Windows 10.0.17134 # [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
                          Platform Win32NT # [System.Environment]::OSVersion.Platform





                          share|improve this answer















                          This is an ancient blog post (2007), but it still applies; in short:




                          • As long as new PowerShell versions remain backward-compatible, they will replace earlier versions:



                            • The installation location, reflected in $PSHOME - $env:systemrootSystem32WindowsPowerShellv1.0 - will remain the same.


                            • The filename extension - .ps1 - will remain the same.



                          • Scripts created for an earlier version will continue to run.


                          • To mark a script as requiring version <n> at a minimum , use #requires -version <n> at the top of the script (technically, it can be placed anywhere in the script, but it makes sense sense to place it at the top).


                          In Windows PowerShell, backward compatibility has been maintained since v1 (current is v5.1 as of this writing - likely the last major version; see below), so both the installation location and the filename extension have remained the same.



                          However, all future effort will go toward the separate, cross-platform PowerShell Core edition, which - as of v6.2.0 - is largely backward-compatible with Windows PowerShell, though its use of .NET Core as the foundation means that certain Windows-specific technologies are fundamentally unavailable - see this blog post.




                          To get the current session's PowerShell version:



                          PS> [string] $PSVersionTable.PSVersion
                          5.1.14393.693 # PSv5.1 example


                          More generally, hashtable $PSVersionTable, introduced in v2, contains several pieces of version information, (incompletely) described in Get-Help about_Automatic_Variables; WinPS below refers to Windows PowerShell, whereas PSCore refers to PowerShell Core:



                          Shared properties:



                          Name Value 
                          ---- -----
                          PSVersion 5.1.14393.693 # The PowerShell version.
                          PSEdition Desktop # 'Desktop'=WinPS; 'Core'=PSCore
                          PSCompatibleVersions 1.0, 2.0, 3.0, 4.0... # array of compatible versions
                          WSManStackVersion 3.0 # WS-Management (WinRM) version
                          PSRemotingProtocolVersion 2.3 # remoting-protocol version
                          SerializationVersion 1.1.0.1 # serialization-protocol version


                          Additional properties exclusive to WinPS:



                          BuildVersion 10.0.14393.693 # ?? Highest supported OS major.minor version, seemingly followed by the build.revision PS version.
                          CLRVersion 4.0.30319.42000 # The .NET Framework CLR version


                          Additional properties exclusive to PSCore:



                          GitCommitId 6.2.0 # The Git commit ID reflecting an RTM tag (e.g., 6.2.0), release tag (e.g., 6.2.0-rc.1) or a specific non-release commit (e.g., 6.2.0-preview.4-108-g5d54f1aa3871a826409496437e25856dc263ccc4)
                          OS Microsoft Windows 10.0.17134 # [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
                          Platform Win32NT # [System.Environment]::OSVersion.Platform






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Mar 26 at 1:43

























                          answered Mar 6 '17 at 4:21









                          mklement0mklement0

                          149k25 gold badges271 silver badges304 bronze badges




                          149k25 gold badges271 silver badges304 bronze badges



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4259241%2fpowershell-installation-folder-and-script-filename-extension-across-versions%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                              SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                              은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현