-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
I found the pwsh
command doesn't parse positional integer parameters as expected when they are negative. This doesn't happen if you use the powershell
command in windows cmd.
Steps to reproduce
script.ps1
is as below.
Param([Int]$number)
Write-Host $number
Expected behavior
$ pwsh script.ps1 -1
-1
Actual behavior
$ pwsh script.ps1 -1
0
Environment data
Name Value
---- -----
PSVersion 6.2.4
PSEdition Core
GitCommitId 6.2.4
OS Darwin 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
mklement0
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime