Skip to content

Range operator (aka DotDot operator) with char operands in pipeline throws error #5519

@TimCurwick

Description

@TimCurwick

Steps to reproduce

A'..'B'
'A'..'B' | ForEach-Object { $_ }

Expected behavior

A
B

Actual behavior

Cannot convert value "A" to type "System.Int32". Error: "Input string was not in a correct format."
At line:1 char:1

  • 'A'..'B' | ForEach-Object { $_ }
  • CategoryInfo : InvalidArgument: (:) [], RuntimeException
  • FullyQualifiedErrorId : InvalidCastFromStringToInteger```

Environment data

----                           -----
PSVersion                      6.0.0-rc
PSEdition                      Core
GitCommitId                    v6.0.0-rc
OS                             Microsoft Windows 10.0.15063
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0```

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtime

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions