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

Closed
wimcoekaerts opened this Issue Jun 9, 2016 · 9 comments

Comments

@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

@andschwa

This comment has been minimized.

Show comment
Hide comment
@andschwa

andschwa Jun 9, 2016

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.

@JamesWTruher @lzybkr @daxian-dbw @mirichmo perhaps we should change -version's behavior to emit PSVersionTable?

Member

andschwa commented Jun 9, 2016

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.

@JamesWTruher @lzybkr @daxian-dbw @mirichmo perhaps we should change -version's behavior to emit PSVersionTable?

@andschwa andschwa added the Usability label Jun 9, 2016

@andschwa andschwa added this to the Future milestone Jun 9, 2016

@andschwa

This comment has been minimized.

Show comment
Hide comment
@andschwa

andschwa Jun 14, 2016

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?

Member

andschwa commented Jun 14, 2016

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?

@JKeithB

This comment has been minimized.

Show comment
Hide comment
@JKeithB

JKeithB Jun 14, 2016

@andschwa I don't think we went that far. What we agreed on so far is only that the $psversiontable information would support semver. We also said that starting Powershell with the -Version XXX parameter would have to support semver, which means that if someone goes to a cmd prompt or PS window and types "Powershell -version 6.0.1-Alpha" it should work & launch that specific version of PowerShell.exe.

JKeithB commented Jun 14, 2016

@andschwa I don't think we went that far. What we agreed on so far is only that the $psversiontable information would support semver. We also said that starting Powershell with the -Version XXX parameter would have to support semver, which means that if someone goes to a cmd prompt or PS window and types "Powershell -version 6.0.1-Alpha" it should work & launch that specific version of PowerShell.exe.

@andschwa

This comment has been minimized.

Show comment
Hide comment
@andschwa

andschwa Jun 14, 2016

Member

@JKeithB Ah, I see. As of now, @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 @JamesWTruher @mirichmo @daxian-dbw @raghushantha

Member

andschwa commented Jun 14, 2016

@JKeithB Ah, I see. As of now, @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 @JamesWTruher @mirichmo @daxian-dbw @raghushantha

@jpsnover

This comment has been minimized.

Show comment
Hide comment
@jpsnover

jpsnover Jun 27, 2016

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
?

Contributor

jpsnover commented Jun 27, 2016

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
?

@andschwa

This comment has been minimized.

Show comment
Hide comment
@andschwa

andschwa Jun 27, 2016

Member

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

Member

andschwa commented Jun 27, 2016

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

@lzybkr

This comment has been minimized.

Show comment
Hide comment
@lzybkr

lzybkr Jun 27, 2016

Member

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

Member

lzybkr commented Jun 27, 2016

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

@jpsnover

This comment has been minimized.

Show comment
Hide comment
@jpsnover

jpsnover Jun 27, 2016

Contributor

@jason: Sounds right to me.

Contributor

jpsnover commented Jun 27, 2016

@jason: Sounds right to me.

@joeyaiello

This comment has been minimized.

Show comment
Hide comment
@joeyaiello

joeyaiello Jun 27, 2016

Member

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.

Member

joeyaiello commented Jun 27, 2016

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.

@joeyaiello joeyaiello modified the milestones: Aug17, Future Jun 27, 2016

@andschwa andschwa referenced this issue Jul 19, 2016

Closed

Preview release plan (prepare switch to public) #1432

11 of 14 tasks complete

@hiteshraigandhi hiteshraigandhi modified the milestones: 6.0.0-Alpha.10, Aug17 Jul 28, 2016

@SandeepSutari SandeepSutari modified the milestones: 6.0.0-Alpha.10, 6.0.0-Alpha.11 Aug 3, 2016

JamesWTruher added a commit to JamesWTruher/PowerShell-1 that referenced this issue Feb 2, 2017

Implement -version parameter in console host (address part of PowerSh…
…ell#1084)

This does not support providing a specific version to run, but
like most other Linux commands, -version will now return the version
of the command. Specifically, the version of the PowerShell engine.

JamesWTruher added a commit to JamesWTruher/PowerShell-1 that referenced this issue Feb 3, 2017

Implement -version parameter in console host (address part of PowerSh…
…ell#1084)

This does not support providing a specific version to run, but
like most other Linux commands, -version will now return the version
of the command. Specifically, the version of the PowerShell engine.

JamesWTruher added a commit to JamesWTruher/PowerShell-1 that referenced this issue Feb 8, 2017

Implement -version parameter in console host (address part of PowerSh…
…ell#1084)

This does not support providing a specific version to run, but
like most other Linux commands, -version will now return the version
of the command. Specifically, the version of the PowerShell engine.

JamesWTruher added a commit to JamesWTruher/PowerShell-1 that referenced this issue Feb 8, 2017

Implement -version parameter in console host (address part of PowerSh…
…ell#1084)

This does not support providing a specific version to run, but
like most other *nix commands, -version will now return the version
of the PowerShell Engine. 'powershell' is prepended to the output to
match other *nix commands. We are using gitcommitid which includes more
info about the build.

JamesWTruher added a commit to JamesWTruher/PowerShell-1 that referenced this issue Feb 17, 2017

Implement -version parameter in console host (address part of PowerSh…
…ell#1084)

This does not support providing a specific version to run, but
like most other *nix commands, -version will now return the version
of the PowerShell Engine. 'powershell' is prepended to the output to
match other *nix commands. We are using gitcommitid which includes more
info about the build.

daxian-dbw added a commit that referenced this issue Feb 23, 2017

Implement -version parameter in console host (address part of https:/… (
#3115)

* Implement -version parameter in console host (address part of #1084)

This does not support providing a specific version to run, but
like most other *nix commands, -version will now return the version
of the PowerShell Engine. 'powershell' is prepended to the output to
match other *nix commands. We are using gitcommitid which includes more
info about the build.

BrucePay added a commit to BrucePay/PowerShell that referenced this issue Mar 17, 2017

Implement -version parameter in console host (address part of https:/… (
#3115)

* Implement -version parameter in console host (address part of PowerShell#1084)

This does not support providing a specific version to run, but
like most other *nix commands, -version will now return the version
of the PowerShell Engine. 'powershell' is prepended to the output to
match other *nix commands. We are using gitcommitid which includes more
info about the build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment