Page 1 of 1

Validate Range Error for Int64 Max Value

Posted: Tue Sep 01, 2020 5:35 pm
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. }

Re: Validate Range Error for Int64 Max Value

Posted: Wed Sep 02, 2020 7:14 am
by brittneyr
Thank you for reporting this issue. This will be addressed in the next service release.

Re: Validate Range Error for Int64 Max Value

Posted: Wed Sep 02, 2020 2:13 pm
by gareth.jacobs
Thanks - just note that I did not test other values - just Int64.