Skip to content

add a command line option to show the version of powershell installed #1084

Closed

Description

@wimcoekaerts

Can you add a version number option so I can do powershell –version –-version or –v or –V so that I know what’s installed

bash --version

GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Would be nice to have same for powershell

powershell –version

Activity

  1. andyleejordan commented on Jun 9, 2016

    @andyleejordan
    Member

    This comes up against the problem where PowerShell already using -Version to specify which version to launch; a feature that will not exist in PowerShell Core. The canonical way of obtaining PowerShell's version is to inspect $PSVersionTable.

    James Truher (@JamesWTruher) Jason Shirk (@lzybkr) Dongbo Wang (@daxian-dbw) Mike Richmond (@mirichmo) perhaps we should change -version's behavior to emit PSVersionTable?

  2. added
    Usability
    on Jun 9, 2016
  3. andyleejordan commented on Jun 14, 2016

    @andyleejordan
    Member

    Per the "handling semver in PowerShell meeting notes", it sounds like we've closed on usurping powershell --version to actually emit the version. @JKeithB is that right?

  4. andyleejordan commented on Jun 14, 2016

    @andyleejordan
    Member

    @JKeithB Ah, I see. As of now, Hemant Mahawar (@HemantMahawar) and I don't think PowerShell Core will support its executable launching different versions of PowerShell by --version, but instead a shim launcher would support this on Windows (due to path issues), and symlinks would be used (as usual) on Linux.

    /cc James Truher (@JamesWTruher) Mike Richmond (@mirichmo) Dongbo Wang (@daxian-dbw) Raghu Shantha (@raghushantha)

  5. jpsnover commented on Jun 27, 2016

    @jpsnover
    Contributor

    So isn't this as simple as

    PowerShell -version x.y.z
    starts powershell using the specified version and
    PowerShell -version
    when no value is provided for version, we return the version
    ?

  6. andyleejordan commented on Jun 27, 2016

    @andyleejordan
    Member

    I agree with Jeffrey Snover (@jpsnover); this isn't a question of CLI syntax; we can support both. Can we get the go-ahead to implement this @JKeithB, Joey Aiello (@joeyaiello)?

  7. lzybkr commented on Jun 27, 2016

    @lzybkr
    Contributor

    powershell -version and no other arguments? Then I agree, but if there are other arguments, we should expect the version number.

  8. jpsnover commented on Jun 27, 2016

    @jpsnover
    Contributor

    Jason (@jason): Sounds right to me.

  9. joeyaiello commented on Jun 27, 2016

    @joeyaiello
    Contributor

    Note: we reserve the right to completely change the output of powershell -version as we try and land on the correct design for people to automate against.

  10. 11 remaining items

  11. modified the milestones: , on Aug 3, 2016
  12. added
    Issue-Enhancement
    Area-SideBySide
    WG-DevEx-Portability
    on Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-SideBySideIssue-EnhancementResolution-FixedUsabilityWG-DevEx-Portability

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions