GeezerVison is showing github.com — Implement -version parameter in console host (address part of https:/… by JamesWTruher · Pull Request #3115 · PowerShell/PowerShell
Implement -version parameter in console host (address part of https:/…
#3115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
There was an error while loading. Please reload this page.
Copy link
Copy Markdown
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sergei (@vors), the @PowerShell/powershell-committee discussed this and that is pretty much the thinking: -version for Windows PowerShell really only supported 2.0 and we're moving away from that. Aligning with Linux convention makes sense. PSCore supports side-by-side intrinsically and using file paths to launch different versions is completely acceptable. #ByDesign
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The reason will be displayed to describe this comment to others. Learn more.
Furthermore we can always do something like powershell -version:2 if people really demand that functionality in the future (and actually Jason Shirk (@lzybkr) and Bruce Payette (@BrucePay) agreed that it would even be acceptable to do powershell -version 2 as it's highly unlikely that anyone wants to echo one int when they shell out to PowerShell).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
All reactions
if (MatchSwitch(switchKey, "version", "v"))
{
_showVersion = true;
_showBanner = false;
_noInteractive = true;
_skipUserInit = true;
_noExit = false;
break;
}
if (MatchSwitch(switchKey, "help", "h") || MatchSwitch(switchKey, "?", "?"))
The reason will be displayed to describe this comment to others. Learn more.
it would report the version and exit - I can add a test for that explicitly if you like. Rather than testing all of the permutations for the parameters, I chose a representative single case
There was an error while loading. Please reload this page.
All reactions
# no extraneous output
$observed | should be $currentVersion
}
}
Context "Pipe to/from powershell" {
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.