Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

powershell -version 2 should return error #4834

Copy link
Copy link
@nightroman

Description

@nightroman
Issue body actions

As far as I know, PowerShell v2 was recently declared deprecated.
Thus, it normal to expect some kind of related errors in the latest v6.

The behaviour is strange, though. If I try to invoke something (anything
actually, including gibberish) with -version 2 then PowerShell succeeds
($LASTEXITCODE is 0) and prints the same result powershell v6.0.0-beta.7.

Steps to reproduce

    powershell -version 2 gibberish
    $LASTEXITCODE

Expected behavior

Non-zero $LASTEXITCODE and a clear error message.

Actual behavior

Zero $LASTEXITCODE and some version-like text, the same regardless of a command.

    powershell v6.0.0-beta.7
    0

Environment data

PowerShell-6.0.0-beta.7-win-x64.zip

Name                           Value
----                           -----
PSVersion                      6.0.0-beta
PSEdition                      Core
GitCommitId                    v6.0.0-beta.7
OS                             Microsoft Windows 10.0.10586
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-Won't FixThe issue won't be fixed, possibly due to compatibility reason.The issue won't be fixed, possibly due to compatibility reason.WG-Interactive-Consolethe console experiencethe console experience

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.