PowerTip: Use PowerShell to Reveal the Size of an [int16]

Doctor Scripto

Summary: Use Windows PowerShell to show the minimum value and the maximum value of an [int16].

Hey, Scripting Guy! Question I need to use an [int16], but I am not sure if it is big enough to hold the number I want to use. How can I determine the minimum and the maximum value of an [int16]?

Hey, Scripting Guy! Answer Use the static MinValue and MaxValue properties from the [int16], as shown here.

13:11 C:\> [int16]::MaxValue

32767

13:11 C:\> [int16]::MinValue

-32768

Note This technique also works for [int32], [int64], and [double].

0 comments

Discussion is closed.

Feedback usabilla icon