Validate Range Error for Int64 Max Value

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
gareth.jacobs
Posts: 29
Joined: Mon May 15, 2017 1:51 pm

Validate Range Error for Int64 Max Value

Post by gareth.jacobs »

Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.181
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19041.0

When adding ValidateRange in a function to an Int64 variable, it incorrectly assumes the value for an Int32 maxvalue (2147483647) and rejects the Int64 maxvalue entry of 9223372036854775807.

When coded manually, the validation works as expected.
  1. function ConvertSpeed {
  2.  
  3.     param
  4.  
  5.     (
  6.  
  7.         [Parameter(Position = 0)]
  8.  
  9.         [ValidateRange(0, 9223372036854775807)]
  10.  
  11.         [int64]$Speed
  12.  
  13.         )
  14.  
  15.         ...
  16.  
  17. }
Attachments
2020-09-02_12-00-58.jpg
2020-09-02_12-00-58.jpg (81.92 KiB) Viewed 431 times

User avatar
brittneyr
Site Admin
Posts: 613
Joined: Thu Jun 01, 2017 7:20 am
Answers: 6
Been upvoted: 5 times

Re: Validate Range Error for Int64 Max Value

Post by brittneyr »

Thank you for reporting this issue. This will be addressed in the next service release.
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
gareth.jacobs
Posts: 29
Joined: Mon May 15, 2017 1:51 pm

Re: Validate Range Error for Int64 Max Value

Post by gareth.jacobs »

Thanks - just note that I did not test other values - just Int64.