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.
This topic is 3 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
gareth.jacobs
Posts: 34
Last visit: Wed Jan 24, 2024 7:43 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.     param
  3.     (
  4.         [Parameter(Position = 0)]
  5.         [ValidateRange(0, 9223372036854775807)]
  6.         [int64]$Speed
  7.         )
  8.         ...
  9. }
Attachments
2020-09-02_12-00-58.jpg
2020-09-02_12-00-58.jpg (81.92 KiB) Viewed 1458 times
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 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
SAPIEN Technologies, Inc.
User avatar
gareth.jacobs
Posts: 34
Last visit: Wed Jan 24, 2024 7:43 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.
This topic is 3 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.