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

System.Management.Automation.SemanticVersion should support more string constructors #1618

Copy link
Copy link
@JamesWTruher

Description

@JamesWTruher
Issue body actions

Steps to reproduce

if ( $psversiontable.psversion -gt "5.0" ) {
  "yay"
}

Expected behavior

yay

Actual behavior

Could not compare "6.0.0-alpha" to "5.0". Error: "Cannot convert value "5.0" to type "System.Management.Automation.SemanticVersion". Error: "Cannot process argument
because the value of argument "version" is not valid. Change the value of the "version" argument and run the operation again.""
At line:1 char:6
+ if ( $psversiontable.psversion -gt "5.0" ) {
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : ComparisonFailure

Environment data

PS /tmp> $psversiontable

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      PowerShellCore
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.7-193-g8f60d488cb4942243d697249c6948d28c56587c7-dirty
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

Type

No type
No fields configured for issues without a type.

Projects

No projects

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.